winrt-xaml

Windows 8 theme color - accessing it programmatically

无人久伴 提交于 2019-12-18 03:33:18
问题 In windows 8 consumer preview you can personalize your experience, including setting a 'background color' which is then also used as the background for selected tiles, app bar etc. So selecting orange will mean that orange accents are visible in the Windows 8 Metro UI. I am currently authoring some custom controls, and I would like to have access to this color in my styling, so as the user changes color so my applications accents are re-colored accordingly. I cannot find a way of getting at

Why doesn't the Windows 8.1 MenuFlyout have ItemsSource property?

梦想与她 提交于 2019-12-17 18:29:18
问题 I was reading this article and could not help but wonder the same thing. Is there a way to databind a menu Flyout control? 回答1: Yes. I put together a simple solution for developers who desire this functionality. It uses an attached property to identify the ItemsSource and the ItemTemplate for a Flyout control. If the developer elects to use a MenuFlyoutItem or something else, it is up to them. Here's the attached property: public class BindableFlyout : DependencyObject { #region ItemsSource

Variable is assigned but its value is never used (C#)

跟風遠走 提交于 2019-12-17 17:16:54
问题 In Visual Studio I used the following code: private bool answer = true; Private Buttonclick() { if() { answer =false } } Compiler gives me a warning that says "answer is assigned but its value is never used". How do I fix this? 回答1: It means you have given answer a value, but not referenced it elsewhere. Meaning you are not using answer elsewhere in your program. You fix it by referencing answer from another part of your program. 回答2: If you want to disable warnings, the error list contains a

How to disable Suspending || Closing || Terminating event for my Metro Style App on Windows 8 Pro

雨燕双飞 提交于 2019-12-17 17:11:50
问题 I'm a french developer and I need to develop an Metro Style app for Windows 8 Pro who is always launched. I wanted to know how can I disable the close event of my app. My app need to be in front all the time and the user couldn't quit the app. I thought I could disable all the shortcut with the GPO but the close gesture (drag the app from the top to the bottom) need to me disabled too. I hope I was clear and everybody will understand the question :-). Feel free to ask me more specific

Could I know if my app is running on Windows RT with C#?

北城以北 提交于 2019-12-17 16:33:03
问题 I know that there is no way to get OS version in Windows Store app, please let me explain more. My app is a Windows Store app programming with C#. Some features of my app is depend on another desktop app (maybe it's not a good design). As I know, a third-party desktop app can not install on Windows RT, so I just want to know if my app is running on Windows RT and forbid some features of my app on Windows RT. I don't want to use GetNativeSystemInfo(), because it's a win32 API, and if I use

Is there a possibility to start another App or Program from a Windows 8 Store App (C#)

旧城冷巷雨未停 提交于 2019-12-17 14:56:18
问题 I want to start another App or Program from my Windows Store App. For example my App is showing emails, so if someone clicks on such an email Outlook should open. Is this possible in an "App-Sandbox"? 回答1: It is not possible to just launch an arbitrary application, but with custom protocol activation you can launch an app that handles that protocol and if it is not installed - the OS will ask the user to install it. It means that if you can define a custom protocol in your app - you can

XAML/C#: What event fires after reordering a gridview?

ε祈祈猫儿з 提交于 2019-12-17 10:44:13
问题 I am making my first Windows Store app in Visual Studios 2012. I have a gridview control that I have enabled to be reordered. I have code that I need to run when the list is reordered. I have tried the Drop event. It does not fire. I tried several other drag events, which also did not fire. It seems like this should be so simple... Thanks for your time! 回答1: You cannot reorder a GridView unless the ItemsSource is bound to an ObservableCollection and CanReorderItems , CanDragItems , and

how to calculate the textbock height and width in on load if i create textblock from code?

∥☆過路亽.° 提交于 2019-12-17 09:53:44
问题 TextBlock tbl= new TextBlock(); tbl.text="Kishore"; double x=tbl.ActualHeight; double y=tbl.ActualWidth; If i execute the code from the loaded event in Metro - winRT will return 0 for both. How can I get the ActualWidth in the Loaded or SizeChanged event? 回答1: Call Measure() then Arrange() and then ActualWidth and ActualHeight will be updated. 回答2: Can also do this via UpdateLayout(); testBlock.ActualWidth This could be useful when calculating multiple objects heights and widths. 回答3:

CollectionViewSource in windows metro app

不想你离开。 提交于 2019-12-14 03:46:13
问题 I have a collection, for which i require 3 different views 1. All data of collection 2. Grouped data (grouping criteria will be modified during application lifecycle ) 3. Filtered data (filter criteria will be modified during application lifecycle) What i want is that all views should bind to same collection so that any change to collection should be synced to all the views. With WPF, this can be achieved using CollectionViewSource. In Modern UI apps, CollectionViewSource still exists, but

DataTrigger with VisualStates in Windows phone 8.1

夙愿已清 提交于 2019-12-14 01:55:01
问题 I'm trying to convert old Window phone 7.5 Silverlight Application to new WinRT Universal application and I have problems with this pice of code: <Style TargetType="Button"> <Setter Property="Visibility" Value="Collapsed"/> <Style.Triggers> <DataTrigger Binding="{Binding Active}" Value="True"> <Setter Property="Visibility" Value="Visible"/> </DataTrigger> </Style.Triggers> </Style> I used DataTrigger to set visibility of control based on binding value. In Windows Phone 8.1 winrt app this