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
最满意答案
这里似乎有一些黑魔法。 或者至少我还没有想出所有的咒语来使这种事情可靠地发生。
我想我有类似的问题。 不知道这是否会帮助你,但这是我如何解决它。
在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时,此处的数据集名称需要与代码中提供的名称相匹配。 我刚刚尝试的新部分是单击“数据源”下拉列表旁边的“新建...”按钮。 生成的向导将引导您选择程序集 ...
-
下列中不属于面向对象的编程语言的是?[2022-05-30]
a -
rdlc打印问题(print problem with rdlc)[2021-12-25]
您需要将数据集提供给您的报告。 就像是: 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 ...
-
隐藏除.rdlc vs2010中最后一行之外的组中的重复项(hide duplicates in a group except last row in .rdlc vs2010)[2022-01-29]
不要使用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 ... -
在VS2010中设计数据模型并生成ORM代码,应用程序(Designing a data model in VS2010 and generating ORM code, application)[2022-12-06]
凯 请考虑使用ADO .NET Framework。 它得到了VS 2010和LINQ( 快速文章 )的支持。 在设计架构之前,您必须了解一件事。 BLL(业务逻辑层)是特定于特定数据使用的逻辑层,因此不能由(无论您将使用什么)框架自动生成。 我想你有数据访问层 - 不要担心 - 如果你要使用ADO .NET和LINQ to Entities,将自动为你生成DAL。 LINQ to Entities与ADO .NET Framework是一套功能强大的工具,可以100%满足您的需求。 有关LINQ to E ... -
MVC4 Source和VS2010(MVC4 Source and VS2010)[2023-01-03]
如此处所述 ,该解决方案现在需要VS2012和Windows 8.我将相应地更新文档Wiki。 As documented here, the solution now requires VS2012 and Windows 8. I'll update the documentation Wiki accordingly. -
在VB.Net中手动在Reportviewer中加载.rdlc报告(Loading .rdlc report in Reportviewer manually in VB.Net)[2022-10-18]
你应该考虑这些说明: 你有一个组合时错误说: BC30311:“ReportDataSource”类型的值无法转换为“ReportDataSource” 因此,您应该检查是否正在使用ReportDataSource正确引用并使用正确名称空间中的类。 一个常见问题是当您在Windows窗体项目中添加Microsoft.Reporting.WebForms.dll作为参考并添加了Import Microsoft.Reporting.WebForms命名空间时,您将收到此类异常。 修复之后,您应该注意报表中Dat ...