winrt-xaml

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

余生长醉 提交于 2019-11-28 02:30:16
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? 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. If you want to disable warnings, the error list contains a button that can stop them being shown in the list. Additionally, a warning is just a warning. They won't stop

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

假装没事ソ 提交于 2019-11-28 02:21:15
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 questions. Cordially Renaud. The short answer is: You can't. The operating system and the user control the

Metro App ListView SelectedItem Selected VisualState

旧巷老猫 提交于 2019-11-28 02:15:16
问题 I have a Metro App with a ListView that contains this definition: <ListView Grid.Row="0" x:Name="lv" CanDragItems="True" CanReorderItems="True" IsTabStop="True" SelectionMode="Extended" VirtualizingStackPanel.VirtualizationMode="Recycling"> <ListView.ItemTemplate> <DataTemplate> <Grid Width="{Binding ElementName=lv, Path=ActualWidth}"> <Grid.RowDefinitions> <RowDefinition/> <RowDefinition/> </Grid.RowDefinitions> <Grid Grid.Row="0"> <Grid.ColumnDefinitions> <ColumnDefinition Width="*"/>

UWP ContentDialog Invocation

断了今生、忘了曾经 提交于 2019-11-28 01:03:37
问题 I am using UWP and Template 10 to build a GUI app by following MVVM pattern. As a part of application I need to invoke a content dialog by pressing button on Main Page. So separate ContentDialog was created in standalone .xaml file for that purpose: <ContentDialog x:Class="UWP1.Views.Speech" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:UWP1.Views" xmlns:d="http://schemas.microsoft.com/expression

Change cursor in Windows Store Apps

喜夏-厌秋 提交于 2019-11-27 23:34:50
I'm making a Windows Store app in C# and I have a normal TextBlock with a link inside it. And all I want to do it to make the cursor change into a hand when it goes over the text block, but unlike in WPF applications, there is no Cursor propriety. I know is a CoreCursor class in Windows.UI.Core . Am I suppose to use it somehow? papaya Window.Current.CoreWindow.PointerCursor = new Windows.UI.Core.CoreCursor(Windows.UI.Core.CoreCursorType.Hand, 1); WinRT XAML Toolkit has an attached property that works just about the same as the Cursor property in WPF in that you set a cursor for an element and

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

南笙酒味 提交于 2019-11-27 23:23:29
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 that API, my app can't compli with any cpu. Yep. Here's how! Task<ProcessorArchitecture> WhatProcessor() {

WinRt WebView control handling navigation within the control

时光总嘲笑我的痴心妄想 提交于 2019-11-27 22:27:22
问题 I have a Metro app using a WebView control. I'm using NavigateToString to load a html file which may contain hyperlinks. What I then want to do is detect when one of these hyperlinks is selected and, instead of allowing navigation within the WebView control, to launch IE and view the page there instead. Is this possible within the WinRT constraints, and if so, how? So far, I've tried capturing the WebView_LoadCompleted() event, but although it does fire at the right time, I can't see any

How do I send an email from a WinRT/Windows Store application?

你离开我真会死。 提交于 2019-11-27 21:29:00
I am developing a Windows Store Application (Windows 8). I have a need to send emails based on data and address stored in the application data and without the need of the user to type it the data or the address. What would be the right/easy way to implement it? EitanB The correct way would be to use Sharing. Your app should create an HTML document or Text and share it. The user would select Mail from the Share charm and the HTML/Text would become the body of the email. See here for more info... http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh973055.aspx You can try with var mailto

With compiled bindings (x:bind), why do I have to call Bindings.Update()?

ε祈祈猫儿з 提交于 2019-11-27 21:21:24
I'm currently experimenting with the new compiled bindings and have reached (again) a point where I'm missing a pice in the puzzle: why do I have to call Bindings.Update ? Until now, I thought implementing INotifyPropertyChanged is enough? In my example, the GUI is only displaying correct values, if I call this mysterious method (which is autogenerated by the compiled bindings). I am using a user control with the following (here simplified) xaml syntax: <UserControl> <TextBlock Text="x:Bind TextValue"/> </UserControl> where TextValue is a simple dependency property of this user control. In a

“UpdateSourceTrigger=PropertyChanged” equivalent for a TextBox in WinRT-XAML

坚强是说给别人听的谎言 提交于 2019-11-27 21:03:26
问题 In WPF, we can update the underlying data model whenever the user makes any change to the data by leveraging UpdateSourceTrigger like this: <TextBox Text="{Binding Path=TextProperty, UpdateSourceTrigger=PropertyChanged}"/> In Window Phone UpdateSourceTrigger was not included in the XAML specification and to accomplish the same, a TextChanged handler was necessary like this: (sender as TextBox).GetBindingExpression(TextBox.TextProperty).UpdateSource(); In Windows 8, I assumed that