windows-runtime

Network checking in WinRT(C# implementation)

孤街浪徒 提交于 2020-01-02 07:52:08
问题 How we can check the status of network in windows 8 metro application. ie the availability of different networks(3g,4g, wifi etc) 回答1: Try this method, I think this is the simplest form of checking network availability in windows 8. http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/thread/d8e76732-19d3-47b3-840f-70d87c75ce9f 回答2: I think this sample download help you.... 来源: https://stackoverflow.com/questions/11797133/network-checking-in-winrtc-implementation

How can I remove pages from a Frame's history?

僤鯓⒐⒋嵵緔 提交于 2020-01-02 07:43:12
问题 How can I manipulate a Frame's history in a WinRT XAML app? The user will start on my hub page, where they can select an existing project to go to its edit screen, or they can select "new project". "New project" will take them through a short wizard, then take them to the "edit project" screen. It makes sense for the wizard pages to just be pages that I navigate to in the frame; that way the user can back out of the wizard if they change their mind. (It'll only be two pages, so "back" can

TLS client certificate authentication on UWP Windows Store app

天涯浪子 提交于 2020-01-02 07:08:12
问题 I'm trying to connect to a server that uses TLS with client certificate authentication. Below is a code snippet: async Task TestClientCertAuth() { int iWinInetError = 0; Uri theUri = new Uri("http://xxx-xxx"); try { using (HttpBaseProtocolFilter baseProtocolFilter = new HttpBaseProtocolFilter()) { // Task<Certificate> GetClientCertificate() displays a UI with all available // certificates with and returns the user selecter certificate. An // oversimplified implementation is included for

Getting number of files in StorageFolder

陌路散爱 提交于 2020-01-02 07:05:31
问题 I was working with a Windows Phone 8.1(RT) application, I wanted to know how to get the number of files inside a StorageFolder . I know we can use StorageFolder.GetFilesAsync() and then check the count of this list returned. But since this method takes too long and returns all items is there more efficient method of getting this done? 回答1: You can get 3 orders of magnitude faster performance if you use Win32 APIs to get the file count, but it only works for your local storage directory (it

ISupportIncrementalLoading Collection - notify UI when LoadingMoreItems is in progress

耗尽温柔 提交于 2020-01-01 19:54:06
问题 I've have created a IncrementalLoadingCollection class in my app which implements ISupportIncrementalLoading and inherits from ObservableCollection< T > . It works fine and the items are loaded but I would like to show a message on the app's Status Bar that there is some work in progress. What's a good way of achieving this? Since LoadMoreItemsAsync is called internally when the list is scrolled, I cannot access that part to come up with the code which updates the Status Bar . Right now, I am

C# Detect Accent Colour Changes WinRT XAML

孤人 提交于 2020-01-01 16:39:14
问题 I am trying to detect changes in the Application.Resources Resource dictionary, so I can automatically change the Titlebar to the Accent Colour when it updates. All of the XAML controls and elements change automatically, and when setting a solid colour brush to the address of the DSDFS brush, its internal value changes. This is the code I have tried to use to detect the change: public static DependencyProperty accent = DependencyProperty.Register("DictChange", typeof(ResourceDictionary),

C# Detect Accent Colour Changes WinRT XAML

旧街凉风 提交于 2020-01-01 16:38:28
问题 I am trying to detect changes in the Application.Resources Resource dictionary, so I can automatically change the Titlebar to the Accent Colour when it updates. All of the XAML controls and elements change automatically, and when setting a solid colour brush to the address of the DSDFS brush, its internal value changes. This is the code I have tried to use to detect the change: public static DependencyProperty accent = DependencyProperty.Register("DictChange", typeof(ResourceDictionary),

How do you capture current frame from a MediaElement in WinRT (8.1)?

纵饮孤独 提交于 2020-01-01 14:55:09
问题 I am trying to implement a screenshot functionality in a WinRT app that shows Video via a MediaElement. I have the following code, it saves a screenshot that's the size of the MediaElement but the image is empty (completely black). Tried with various types of Media files. If I do a Win Key + Vol Down on Surface RT, the screen shot includes the Media frame content, but if I use the following code, it's blackness all around :( private async Task SaveCurrentFrame() { RenderTargetBitmap

Adjust the size of a XAML Grid.Background Image

我与影子孤独终老i 提交于 2020-01-01 09:43:45
问题 I have a simple piece of XAML that lays out a group of tiles, each with a background image icon. <Grid.Background> <ImageBrush Stretch="None" ImageSource="{Binding ImageSource}" AlignmentY="Center" AlignmentX="Center"/> </Grid.Background> This works fine, except the background image fills the square perfectly. I'm sure XAML thinks this is fine, but actually it needs to be about half the size to match spec. I tried several things including adding a border to the grid (which truncates the

Binding to the IsSelected property of the parent ListViewItem

巧了我就是萌 提交于 2020-01-01 08:24:36
问题 I'm attempting to bind the Visibility property of a TextBlock that's held within the ItemTemplate for a ListView to the IsSelected property of the TextBlock's parent ListViewItem. With this markup, the TextBlock is always visible. <ListView x:Name="ItemListView" ItemsSource="{Binding Path=Accounts}" Margin="60,0,0,10" Grid.Row="1" Grid.Column="0"> <ListView.ItemTemplate> <DataTemplate> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="100"> </ColumnDefinition> <ColumnDefinition Width="