microsoft-metro

File Save Picker - Save Edited Image (C# Metro app)

China☆狼群 提交于 2019-12-11 02:48:20
问题 I want to open an image, edit it, and then save it. I am able to open a file, but I have problems saving it. The way I have written the code, I can only save a file with .jpg but there is nothing in it. Please explain to me how to save the image I have opened and edited(not made yet). public sealed partial class MainPage : Page { BitmapImage originalImage = new BitmapImage(); public MainPage() { this.InitializeComponent(); } private async void OpenButton_Click(object sender, RoutedEventArgs e

In metro, what's the difference between FolderInformation and StorageFolder

假装没事ソ 提交于 2019-12-11 02:39:27
问题 FolderInformation 's methods/properties are nearly the same with StorageFolder 's. I can't figure out why WinRT api provides FolderInformation and StorageFolder as well. If I assign the list created from FileInformationFactory.GetFoldersAsync() to an ItemsControl , does it differ from the listed created from StorageFolder.CreateFolderAsync() ? The document says the FolderInformation provides synchronous access, but I don't know when the issue would happen. The one drawback I found in

How to diagnose metro app deployment errors?

£可爱£侵袭症+ 提交于 2019-12-11 01:49:27
问题 When trying to debug a Metro project from VS, I came across this error: DEP0700 : Registration of the app failed. Another user has already installed a packaged version of this app. An unpackaged version cannot replace this. The conflicting package is PACKAGENAME and it was published by CN=some Guid. (0x80073cf9) But I have already uninstalled the app from the Start page, also, I can confirm that there is no entry left in Add/Remove program. And since the access to the "%PROGRAMFILES%

Can we access Windows 8 WinRT API from desktop application and Windows Phone 8 app? If so, are they in different namespaces?

不羁岁月 提交于 2019-12-11 01:36:25
问题 Over the course of time I received a number of comments on my blog in this area. Many questions were asked like “Can you use WinRT from Desktop applications?”, “Can you use WinRT from .NET applications?”, “Can you use WinRT from .NET applications?” etc? If so, how? 回答1: Yes, you can and for more information refer to http://kishore1021.wordpress.com/2012/08/14/can-you-use-windows-8-winrt-api-from-net-desktop-applications/ Coming to architecting such applications, the best way to go forward is

How can I calculate the width of a string in Metro (without displaying it)?

混江龙づ霸主 提交于 2019-12-11 01:33:35
问题 I have failed to find a Windows Runtime equivalent to the following WPF code to measure the width of a string: FormattedText formattedText = new FormattedText(in_string,in_culture,in_flowdir,in_font,in_sz,in_color); string_width = formattedText.WidthIncludingTrailingWhitespace); Does anybody know if it can be done in Metro? 回答1: It is possible, I've found one method that gives useful measurements, but I am not sure it is the best way of doing it: // Setup the TextBlock with *everything* that

XAML - ListViewItem - IsEnabled Binding

£可爱£侵袭症+ 提交于 2019-12-11 01:31:50
问题 Please put me out of my misery: <ListView.ItemContainerStyle> <Style TargetType="ListViewItem"> <Setter Property="IsEnabled" Value="{Binding MyBoolField}" /> </Style> </ListView.ItemContainerStyle> Where MyBoolField is a property available on each item in the ListView 's assigned ItemsSource , and is of course of type bool . The desired behaviour is that the IsEnabled property of each ListViewItem is bound to the MyBoolField property of the object it contains (an element from the ListView 's

Windows 8 Metro App (Grid Application) transition with black flickering

a 夏天 提交于 2019-12-11 01:12:06
问题 I'm building a Windows 8 Metro App based on the Grid Application template. Everything was going smoothly until I tried to change the Theme and Background of the App. I applied an Image Background to all 3 XAML Page's Grid. Also, I changed the Theme to "Light" in the Application Package Manifest, but it didn't do anything. After searching I found a solution, setting RequestedTheme="Light" in the App.xaml Now, I have a Light themed Application with the background I want, but every time I

Play audio in background by use BackgroundCapableMedia

梦想的初衷 提交于 2019-12-11 00:56:46
问题 In the windows8 Developer preview we can use this code to play audio in background: mediaElement.AudioCategory = AudioCategory.Media; In the windows8 Customer perview, It seems that we should use AudioCategory.BackgroundCapableMedia instead of AudioCategory.Media mediaElement.AudioCategory=AudioCategory.BackgroundCapableMedia; and I also Declare a background task in appxmanifest <Extension Category="windows.backgroundTasks" EntryPoint="TestApp.App"> <BackgroundTasks> <Task Type="audio" /> <

RichTextBlock paragraphs background color

坚强是说给别人听的谎言 提交于 2019-12-11 00:48:48
问题 I have a RichTextBlock with a couple of paragraphs. I need some paragraphs to have a background color. I cannot find the Background property on Paragraph or Run. How do I do this? In WPF there is a Block but it does not seem to be present in WinRT. 回答1: It is not possible but it is Possible to insert a InlineUIContainer with a StackPanel with a background. 回答2: You'll need to get the index for the start of the paragraph and for the end of the paragraph and then use: //Select the line from it

Simple hover effect in XAML?

此生再无相见时 提交于 2019-12-10 23:33:33
问题 So, I was recently frustrated with a challenge to copy this effect: <style> a:hover {background-color:yellow; } </style> Using the XAML implementation in WinRT. What is the most condense solution? 回答1: Okay, so here's my attempt: <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="VisualStateGroup"> <VisualState x:Name="Normal"/> <VisualState x:Name="Hover"> <Storyboard> <ColorAnimation To="Yellow" Duration="0" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)