windows-runtime

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

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

How do I create a self-signed certificate in a WinRT application?

折月煮酒 提交于 2019-12-11 01:32:51
问题 I'm trying to write a WinRT application which communicates with Windows Azure's management APIs. In order to do this, a certificate has to be uploaded which meets certain requirements and is then used by the application to authenticate requests. To make for a better user experience, I want to be able to generate the certificate for them and configure the application to use the certificate. Normally, I would reach for the System.Security.Cryptography namespace, but it would appear to be

Incremental Hashing in WinRT/Metro

﹥>﹥吖頭↗ 提交于 2019-12-11 01:27:13
问题 I'm porting some code that uses incremental SHA-1 heavily: SHA1 hasher = HashAlgoFactory.Create<SHA1>(); hasher.Initialize(); DiskIOCallback readCallback = null; readCallback = delegate(bool successful) { if (successful) hasher.TransformBlock(hashBuffer, 0, count, hashBuffer, 0); offset += count; if (!successful || offset == endOffset) { object hash = null; if (successful) { hasher.TransformFinalBlock(hashBuffer, 0, 0); hash = hasher.Hash; } And am looking for a WinRT/Metro equivalent. I've

How to change value of a defined resource in xaml?

冷暖自知 提交于 2019-12-11 01:26:56
问题 I have a grid in the xaml which uses a resource for its attached flyout: <Grid > <FlyoutBase.AttachedFlyout> <StaticResource ResourceKey="GridFlyout"/> </FlyoutBase.AttachedFlyout> .. other stuffs </Grid> and I have a defined resource in the page: <Page.Resources> <MenuFlyout x:Key="GridFlyout"> <MenuFlyoutItem Text="delete"/> <MenuFlyoutItem Text="like"/> <MenuFlyoutItem Text="edit"/> </MenuFlyout> But in some conditions I want to set the following resource for the above grid: <Page

Add ThumbToolTip to Slider

与世无争的帅哥 提交于 2019-12-11 01:26:32
问题 How to add a ThumbToolTip to a Slider (currently I'm working with Windows Phone 8.1 RT)? According to MSDN - there is a property that should enable ThumbTooltip. But as I've looked at default style there is no sign of ToolTip. I've tried to set the value to true (which is also a default value): <Slider Maximum="100" Value="10" HorizontalAlignment="Stretch" ThumbToolTipValueConverter="{StaticResource ToolTipConv}" IsThumbToolTipEnabled="True"/> But no ToolTip was shown. I can think of making a

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

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

WinRT StorageFile DisplayName strange behavior

淺唱寂寞╮ 提交于 2019-12-11 01:04:10
问题 In a Windows 8 app on Windows 8.1 I use the DisplayName property of StorageFile to get a 'friendly' file name. In the majority of the cases the result is the name of the file without the extension but sometimes the result is the name of the file with the extension. This second case seems to happen when I create a new folder and immediately create a file in it. Does anyone know if there is a consistent rule for this behavior? Thanks! 回答1: It is a strange but You can create extension method