首页 \ 问答 \ ApplicationBar WP7(ApplicationBar WP7)

ApplicationBar WP7(ApplicationBar WP7)

我想知道为什么当我加载我的Windows手机项目时,应用程序栏出现在我的第一个屏幕上,这只是一个加载背景..

如何让它出现在加载的最后。

这是我使用的代码。

public MainPage()
    {
        InitializeComponent();

        AnimationContext = LayoutRoot;  //  for page transitions
        _tappedListBox = null;   //  used for setting the activated ListBox on panorama for animation to map page

        // If the constructor has been called, this is not a page that was already in memory:
        _newPageInstance = true;

        //  Setup the background thread worker properties:
        _worker = new BackgroundWorker();   //  Create a background thread worker for downloading/installing park maps
        _worker.WorkerReportsProgress = true;
        _worker.WorkerSupportsCancellation = true;
        _worker.DoWork += new DoWorkEventHandler(worker_DoWork);
        _worker.ProgressChanged += new ProgressChangedEventHandler(worker_ProgressChanged);
        _worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(worker_RunWorkerCompleted);

        // Set the data context of the listbox control to the sample data
        this.DataContext = App.ViewModel;
        this.Loaded += new RoutedEventHandler(MainPage_Loaded);


    }

我在这里设置了可见性。

    private void MainPage_Loaded(object sender, RoutedEventArgs e)
    {
        if (!App.ViewModel.IsDataLoaded)
            App.ViewModel.LoadData();
        ;   //  load panorama data (if need to)

        if (!App.ViewModel.IsDataLoaded == false)
        {
            this.ApplicationBar.IsVisible = true;
        }
    }

I am wondering why when I load my windows phone project, the application bar is appearing on my first screen wich is just a loading background..

How can I make it appear at the really end of the loading.

This is the code I use.

public MainPage()
    {
        InitializeComponent();

        AnimationContext = LayoutRoot;  //  for page transitions
        _tappedListBox = null;   //  used for setting the activated ListBox on panorama for animation to map page

        // If the constructor has been called, this is not a page that was already in memory:
        _newPageInstance = true;

        //  Setup the background thread worker properties:
        _worker = new BackgroundWorker();   //  Create a background thread worker for downloading/installing park maps
        _worker.WorkerReportsProgress = true;
        _worker.WorkerSupportsCancellation = true;
        _worker.DoWork += new DoWorkEventHandler(worker_DoWork);
        _worker.ProgressChanged += new ProgressChangedEventHandler(worker_ProgressChanged);
        _worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(worker_RunWorkerCompleted);

        // Set the data context of the listbox control to the sample data
        this.DataContext = App.ViewModel;
        this.Loaded += new RoutedEventHandler(MainPage_Loaded);


    }

And i set the visibility here .

    private void MainPage_Loaded(object sender, RoutedEventArgs e)
    {
        if (!App.ViewModel.IsDataLoaded)
            App.ViewModel.LoadData();
        ;   //  load panorama data (if need to)

        if (!App.ViewModel.IsDataLoaded == false)
        {
            this.ApplicationBar.IsVisible = true;
        }
    }

原文:https://stackoverflow.com/questions/9686322
更新时间:2022-12-13 14:12

最满意答案

这里似乎有一些黑魔法。 或者至少我还没有想出所有的咒语来使这种事情可靠地发生。

我想我有类似的问题。 不知道这是否会帮助你,但这是我如何解决它。

在VS2010报表设计器中,使用查看 - >报表数据显示报表数据窗格。

点击新建按钮并选择数据集...获取数据集属性对话框。

为您的数据集命名,如果您之前完成了此操作,则可能知道在绑定ReportDataSource时,此处的数据集名称需要与代码中提供的名称相匹配。

我刚刚尝试的新部分是单击“数据源”下拉列表旁边的“新建...”按钮。 生成的向导将引导您选择程序集和CLR类(使用复选框选择您的类)。

当向导完成时,我的新数据集出现了。

有一点需要注意:我第一次尝试重现这一点时,向导完成了而不添加我的数据集。 我回到我的类定义并使用[DataContract][DataMember]属性对其进行了修饰,然后重新运行该向导,它似乎效果很好。

也许有更深层次知识的人可以评论这些属性为什么使这项工作成为可能,或者为什么如果没有它们,向导会失败。


Your data source object must include a native data type as a property on the class, otherwise it doesn't let you add it. Funny, eh!

相关问答

更多
  • 对于Google搜索到的用户,报表数据面板通常是隐藏的,可以在查看 - >报表数据(Ctrl + Alt + D)下的菜单中找到...它位于底部: http:// www .codeease.com /约-更新数据集-FOR-A-RDLC文件,在视觉工作室-2010.html 一旦完成,您可以右键单击报告数据集并刷新或编辑它们。 这一直对我有用(一旦我记得并找到报告数据面板!),所以我不知道为什么它不适用于OP。 Well, I resolved my problem, but I don't like h ...
  • 这里似乎有一些黑魔法。 或者至少我还没有想出所有的咒语来使这种事情可靠地发生。 我想我有类似的问题。 不知道这是否会帮助你,但这是我如何解决它。 在VS2010报表设计器中,使用查看 - >报表数据显示报表数据窗格。 点击新建按钮并选择数据集...获取数据集属性对话框。 为您的数据集命名,如果您之前完成了此操作,则可能知道在绑定ReportDataSource时,此处的数据集名称需要与代码中提供的名称相匹配。 我刚刚尝试的新部分是单击“数据源”下拉列表旁边的“新建...”按钮。 生成的向导将引导您选择程序集 ...
  • 您需要将数据集提供给您的报告。 就像是: viewer.LocalReport.DataSources.Add(new ReportDataSource("dataset1", dataTable)); 编辑:根据您的评论 private void Window_Loaded(object sender, RoutedEventArgs e) { var dataTable = report_insurance(fromDate, toDate); viewer_insurance.Lo ...
  • 这里有几个解决方案,但我更喜欢第二个解决方案。 解决方案1 (好的) 由于这似乎是MVC Web应用程序项目类型自身的一个缺陷,因此您可以将报告添加到不同的项目类型(如类库)。 如在Visual Studio 2010报表查看器 - 对象数据源发布后所述,只需为项目创建一个单独的库并在其中添加rdlc文件即可。 数据源配置向导现在应该如下所示: 解决方案2 (更好) 正如在ASP.NET MVC中无法在RDLC报表中看到或添加网站数据源一样 ,您可以在MVC项目的任何位置添加一个aspx页面,以诱使Visu ...
  • 通过您收到的错误消息,并通过查看以下行: Dim rds As ReportDataSource = New ReportDataSource("DS1", ReportDS.Tables(0)) 我可以得出这样的结论:DataSet在RDLC中定义为“DataSet”,并将其作为“DS1”提供。 改成: Dim rds As ReportDataSource = New ReportDataSource("DataSet1", ReportDS.Tables(0)) By the error mess ...
  • 不要使用HideDuplicates,而是使用文本框/行的隐藏属性。 像这样的东西可以工作: =IIf(RowNumber("Group1") = Count(Fields!OneOfYourFields.Value, "Group1"), False, True) Don't use HideDuplicates but the Hidden property of your textbox/row. Something like this could work: =IIf(RowNumber("Gro ...
  • 凯 请考虑使用ADO .NET Framework。 它得到了VS 2010和LINQ( 快速文章 )的支持。 在设计架构之前,您必须了解一件事。 BLL(业务逻辑层)是特定于特定数据使用的逻辑层,因此不能由(无论您将使用什么)框架自动生成。 我想你有数据访问层 - 不要担心 - 如果你要使用ADO .NET和LINQ to Entities,将自动为你生成DAL。 LINQ to Entities与ADO .NET Framework是一套功能强大的工具,可以100%满足您的需求。 有关LINQ to E ...
  • 如此处所述 ,该解决方案现在需要VS2012和Windows 8.我将相应地更新文档Wiki。 As documented here, the solution now requires VS2012 and Windows 8. I'll update the documentation Wiki accordingly.
  • 你应该考虑这些说明: 你有一个组合时错误说: BC30311:“ReportDataSource”类型的值无法转换为“ReportDataSource” 因此,您应该检查是否正在使用ReportDataSource正确引用并使用正确名称空间中的类。 一个常见问题是当您在Windows窗体项目中添加Microsoft.Reporting.WebForms.dll作为参考并添加了Import Microsoft.Reporting.WebForms命名空间时,您将收到此类异常。 修复之后,您应该注意报表中Dat ...

相关文章

更多

最新问答

更多
  • 如何在Laravel 5.2中使用paginate与关系?(How to use paginate with relationships in Laravel 5.2?)
  • linux的常用命令干什么用的
  • 由于有四个新控制器,Auth刀片是否有任何变化?(Are there any changes in Auth blades due to four new controllers?)
  • 如何交换返回集中的行?(How to swap rows in a return set?)
  • 在ios 7中的UITableView部分周围绘制边界线(draw borderline around UITableView section in ios 7)
  • 使用Boost.Spirit Qi和Lex时的空白队长(Whitespace skipper when using Boost.Spirit Qi and Lex)
  • Java中的不可变类(Immutable class in Java)
  • WordPress发布查询(WordPress post query)
  • 如何在关系数据库中存储与IPv6兼容的地址(How to store IPv6-compatible address in a relational database)
  • 是否可以检查对象值的条件并返回密钥?(Is it possible to check the condition of a value of an object and JUST return the key?)
  • GEP分段错误LLVM C ++ API(GEP segmentation fault LLVM C++ API)
  • 绑定属性设置器未被调用(Bound Property Setter not getting Called)
  • linux ubuntu14.04版没有那个文件或目录
  • 如何使用JSF EL表达式在param中迭代变量(How to iterate over variable in param using JSF EL expression)
  • 是否有可能在WPF中的一个单独的进程中隔离一些控件?(Is it possible to isolate some controls in a separate process in WPF?)
  • 使用Python 2.7的MSI安装的默认安装目录是什么?(What is the default installation directory with an MSI install of Python 2.7?)
  • 寻求多次出现的表达式(Seeking for more than one occurrence of an expression)
  • ckeditor config.protectedSource不适用于editor.insertHtml上的html元素属性(ckeditor config.protectedSource dont work for html element attributes on editor.insertHtml)
  • linux只知道文件名,不知道在哪个目录,怎么找到文件所在目录
  • Actionscript:检查字符串是否包含域或子域(Actionscript: check if string contains domain or subdomain)
  • 将CouchDB与AJAX一起使用是否安全?(Is it safe to use CouchDB with AJAX?)
  • 懒惰地初始化AutoMapper(Lazily initializing AutoMapper)
  • 使用hasclass为多个div与一个按钮问题(using hasclass for multiple divs with one button Problems)
  • Windows Phone 7:检查资源是否存在(Windows Phone 7: Check If Resource Exists)
  • 无法在新线程中从FREContext调用getActivity()?(Can't call getActivity() from FREContext in a new thread?)
  • 在Alpine上升级到postgres96(/ usr / bin / pg_dump:没有这样的文件或目录)(Upgrade to postgres96 on Alpine (/usr/bin/pg_dump: No such file or directory))
  • 如何按部门显示报告(How to display a report by Department wise)
  • Facebook墙贴在需要访问令牌密钥后无法正常工作(Facebook wall post not working after access token key required)
  • Javascript - 如何在不擦除输入的情况下更改标签的innerText(Javascript - how to change innerText of label while not wiping out the input)
  • WooCommerce / WordPress - 不显示具有特定标题的产品(WooCommerce/WordPress - Products with specific titles are not displayed)