windows-8

Windows 8 Button click programmatically in C# and Xaml

早过忘川 提交于 2019-12-11 01:56:38
问题 I want to click button programatically in C# xaml. As I found that there is no method like PerformClick. What else is the alternative for it. Actually I have set of 10 buttons with x:Name like btn1, btn2, btn3 etc... I have a number from 1 to 10 based on that number I need to click these buttons. I was planning to get the control by using ParentControl.FindName('btn' + number) and then fire the event from that. But since there is no PerformClick method in Windows 8 C# hence i need an

Unable to detect the selected FileTypeChoice from FileSavePicker

扶醉桌前 提交于 2019-12-11 01:56:29
问题 I would like to let the user choose a save option while selecting a file type. The selection works fine as in the below example. However after the user has selected a file type to be saved, I have not found a possibility to check which type he has selected. Please note: Both file type choices have the same extension. The difference between the two is the display name. var fsp = new FileSavePicker(); fsp.FileTypeChoices.Add("my file type", new List<string> {".extension"}); fsp.FileTypeChoices

How may I create a C++(/CX ?) _DESKTOP_ Windows 8 application using XAML for GUI?

左心房为你撑大大i 提交于 2019-12-11 01:37:17
问题 how may I create a C++ (maybe requiring /CX extension) desktop Windows 8 application using XAML (and its visual editor) for the GUI? To be explicit NOT creating a Windows store application, I mean, something similar to using plain C++ and Qt (with Designer). 回答1: Windows Desktop and Windows App Store are essentially incompatible target environments. There is no desktop XAML (i.e. WPF) project type for C++. Your options are: use WinForms to create a C++/CLI desktop app with a designer use MFC

Bind property to method

允我心安 提交于 2019-12-11 01:36:50
问题 I am developing a Windows 8 App in C# and using databinding <CollectionViewSource x:Name="departments" Source="{Binding Departments}" d:Source="{Binding AllGroups, Source={d:DesignInstance Type=data:Department, IsDesignTimeCreatable=True}}"/> I can bind the properties of this class to my UI, but the class also has this method I need public String getProfessorsList() I would like to be able to bind the method like this... <TextBlock Text="{Binding getHeads()}" FontSize="18" /> ...but obviously

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

Is WinRT capable of running Win 7 and 8 desktop apps?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 01:34:33
问题 I read a lot of different opinions on it, but is WinRT an actual desktop OS like Win 7 and 8? Will you be able to run fully featured desktop applications and games? 回答1: WinRT is not a desktop or an OS, it is an API. Just like the traditional winapi. It is fundamentally different from the winapi, it is COM based instead of C based and it doesn't expose all of the underlying OS capabilities. And runs in a strong sandbox that prevents using the kind of apis that malware likes to use. Roughly,

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

Playing youtube video in windows 8 app

和自甴很熟 提交于 2019-12-11 01:26:08
问题 I have been trying to play a youtube video in a windows 8 html5 & javascript app with no luck! I tried copy pasting the code youtube provided for embedding videos in the body of default.html, for example: <iframe width="420" height="315" src="http://www.youtube.com/embed/k07IaB9yq_U" frameborder="0" allowfullscreen></iframe> This gives the following error: The Adobe Flash player or an HTML5 supported browser is required for video playback. Get the latest flash player Learn more about updating

winrt, javascript, image from byte array

岁酱吖の 提交于 2019-12-11 01:25:13
问题 I have a C++/CX component that can return an image as a stream (I could easily make it return an IBuffer, if that makes things easier). Currently, the component's return type is IRandomAccessStream and the actual stream is a InMemoryRandomAccessStream. I want to use this stream as the source for an image in a HTML/JavaScript Windows 8 app. The problem is that I don't know how to shove this stream, or an array that I can create from it, into the image. I've tried a few things, but for example