microsoft-metro

MessageDialog - needs to wait for user input

☆樱花仙子☆ 提交于 2020-01-13 19:11:30
问题 I have a ViewModel which instantiates an event in a synchronous method. The event signals to the UI that we need a "Yes" or "No" answer from the user before continuing. I am trying to display a MessageDialog and wait until the user provides an answer - Yes or No. I am having a difficult time doing this. I currently get an UnauthorizedAccessException when trying to do this. Here's a look at the code in the UI: async Task<bool> Instance_SwitchConfirmation(string question) { MessageDialog md =

How to print Formatted Page which contain ListBox or GridView

别等时光非礼了梦想. 提交于 2020-01-13 03:44:25
问题 Printing Document using WinRT : 1) To Keep tracking if there are more data Or text data to print in a formatted page. This can be done using RichTextBlock and RichTextBlockOverflow like below: <RichTextBlock Foreground="Black" x:Name="textContent" FontSize="18" Grid.Row="1" Grid.ColumnSpan="2" OverflowContentTarget="{Binding ElementName=firstLinkedContainer}" IsTextSelectionEnabled="True" TextAlignment="Left" FontFamily="Segoe UI" VerticalAlignment="Top" HorizontalAlignment="Left"> <

Drop-down Selection Control - Windows 8 Metro - XAML

允我心安 提交于 2020-01-12 14:26:51
问题 I want the dropdowns like in the pictures below: I dont know how I get them. I suppose that these are some kind of comboboxes but I am not sure. Can anyone help me and provide the xaml code?! Thanks. 回答1: I suppose you are looking for Combo box : Windows 8 store controls list (MSDN) . To use: <ComboBox x:Name="comboBox1" SelectionChanged="ComboBox_SelectionChanged" Width="100"> <x:String>Item 1</x:String> <x:String>Item 2</x:String> <x:String>Item 3</x:String> </ComboBox> 回答2: you would have

Drop-down Selection Control - Windows 8 Metro - XAML

可紊 提交于 2020-01-12 14:26:34
问题 I want the dropdowns like in the pictures below: I dont know how I get them. I suppose that these are some kind of comboboxes but I am not sure. Can anyone help me and provide the xaml code?! Thanks. 回答1: I suppose you are looking for Combo box : Windows 8 store controls list (MSDN) . To use: <ComboBox x:Name="comboBox1" SelectionChanged="ComboBox_SelectionChanged" Width="100"> <x:String>Item 1</x:String> <x:String>Item 2</x:String> <x:String>Item 3</x:String> </ComboBox> 回答2: you would have

What is the difference between Task<> and IAsyncOperation<>

天大地大妈咪最大 提交于 2020-01-11 04:24:21
问题 I am writing a metro app. This works: HttpClient client = new HttpClient(); var bytes = await client.GetByteArrayAsync(new Uri("www.microsoft.com")); This doesn't: var folder = Windows.Storage.ApplicationData.Current.LocalFolder; var file = await folder.GetFileAsync("text.txt"); The first one returns a Task<>, the second one return an IAsyncOperation<> What is the difference? Why are there two different types? How can I fix the second sample? 回答1: IAsyncOperation is a metro asynchronous

WPF/Metro-style: Making ListView show only complete items

好久不见. 提交于 2020-01-10 05:16:41
问题 In my Metro application, I have a data source containing a certain number of items (say 25). I have a ListView that presents those items. My problem is that the ListView have a size that allows it to display, say, 6.5 items, so that the last item it displays is cut in half. If the resolution changes, it might display 4 items, or 8.2 items, or whatever. What I'd like is that the ListView shows exactly the number of items that fits in the height of the control, instead of clipping the last item

How to convert Platform::String to char*?

允我心安 提交于 2020-01-09 03:49:27
问题 How do I convert the contents of a Platform::String to be used by functions that expect a char* based string? I'm assuming WinRT provides helper functions for this but I just can't find them. Thanks! 回答1: Platform::String::Data() will return a wchar_t const* pointing to the contents of the string (similar to std::wstring::c_str() ). Platform::String represents an immutable string, so there's no accessor to get a wchar_t* . You'll need to copy its contents, e.g. into a std::wstring , to make

Pixastic javascript library is returning false in image tag when i am trying to use it in Windows 8 Metro Style app in javascript?

社会主义新天地 提交于 2020-01-07 02:30:46
问题 I am trying to use Pixastic JavaScript library for image manipulation in Windows 8 Metry Style app using JavaScript as language. I am passing canvas as input parameter and trying to get image and binging again to canvas but the image value that i am getting all the time is FALSE. CODE: // First, draw it into the backing canvas context.drawImage(video, 0, 0, width, height); // change brightness and contrast Pixastic.Client.isIE = false; Pixastic.process(canvas, 'brightness', { 'brightness': 2,

Adcontrol does not show ads with pub center App id and Unit id

拜拜、爱过 提交于 2020-01-06 20:25:11
问题 I have an Adcontrol which works fine with test values given by Msdn but does not shows ads with actual values.(Windows Store App) 回答1: This could be a perfectly normal behaviour if there is no ad to display. You can suscribe to the ErrorOccured event of the AdControl and check the Error property to confirm that by seeing a "No fill" message. 来源: https://stackoverflow.com/questions/34148828/adcontrol-does-not-show-ads-with-pub-center-app-id-and-unit-id

create image from character

心不动则不痛 提交于 2020-01-06 20:01:28
问题 I'm using standard styles for my Metro app. Most of these styles contains an Image and I wanna use Segoe UI Symbol s as these images. how can I achieve this? 回答1: You can insert the "character" in any text content that is using the Segoe UI Symbol as the font. If I wanted a Favorite's Star in a TextBlock, it would look like this... <TextBox x:Name="textBox" HorizontalAlignment="Left" Margin="372,375,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" FontFamily="Segoe UI Symbol"/> If I