windows-runtime

Styling Windows Phone 8.1/WinRT AppBarButton

人走茶凉 提交于 2019-12-06 12:23:00
I'm currently looking to implement a CommandBar for a WinRT Windows Phone 8.1 app. Overall it is very straightforward but I am unable to style the control. I have themed my app so that the accent colour has been changed to green. This works well for pretty much everywhere in the app (buttons, textblocks etc.) but not for the AppBarButton. The brushes I'm overriding are SystemColorControlAccentBrush and PhoneAccentBrush but changing these does not make any difference to the colour of the AppBarButton when pressed: Any idea what I'm doing wrong/can this colour be changed? Set the CommandBar's

Countdown timer for metro App

余生颓废 提交于 2019-12-06 11:57:30
I'm beginner in Metro Style Developing, I tried to make a small game that's need a timer, countdown from 10 to 0. But at this Visual Studio there is no Timer Component, and DispatcherTimer Not mapped to an xmlns. I Tried to use TimeSpan, that have this field "TicksPerSecond" But this example dosen't help me to make my countdown timer : http://msdn.microsoft.com/en-us/library/system.timespan.tickspersecond.aspx TimeSpan also have this method "FromSeconds", and i Can't also use this one for my countdown timer : http://msdn.microsoft.com/en-us/library/system.timespan.fromseconds.aspx also I Read

Image flickering in Windows RT App

安稳与你 提交于 2019-12-06 11:49:46
I have a Windows RT app where I programmatically change the Bitmap in the Image component. All works well with the XAML and the code below except the flickering we see when the image is changed. What should I change to get rid of the flickering? XAML : <Page x:Class="iSurfBrainViewProto01.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:iSurfBrainViewProto01" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc

Create a theme in Windows 8.1

荒凉一梦 提交于 2019-12-06 11:35:35
In Windows 8, you were able to create your own themes for your application ( here's a tutorial ). In Windows 8.1 Applications, themes are handled differently: you can change them at run-time and set a theme for a specific control in your XAML (if you don't want to apply the theme to the whole Application). For instance: <Grid x:Name="MainGrid" RequestedTheme="Dark"> However, I could not find a way to create my own themes. The property RequestedTheme takes an enumeration (its type is FrameworkElement.RequestedTheme ) and an enumeration by definition cannot be extended (in C#). Also, if I want

How to share Windows 8 WinRT Metro style libaries/components across apps

Deadly 提交于 2019-12-06 11:30:48
The Metro documentation states that the applications are self-consistent (no shared DLL’s, etc), So I’m just wondering how you can create a modular, BIG Metro application by creating reusable components/libraries. Considering the case for HTML5/JavaScript Metro apps, if a lot of them should contain the same CSS and JavaScript (consider jQuery, templates) or WinJS scripts then it doesn't look quite good … I expected some form of libraries/reuse to exist from the start. The HDD space is definitely cheap nowadays but I think that a versioned library repository should be in place and the

How to get GridView.Selected Item's Scroll Position in Windows 8 Metro App

和自甴很熟 提交于 2019-12-06 11:24:44
问题 I am selecting gridview item using code, so I also need my gridview to Scrolls at selected item's position , I tried GridView.ScrollintoPosition() but it is not working . IS there any way to get the Scroll position of SelectedItem so that I can scroll it using scrollViewer1.ScrollToHorizontalOffsetWithAnimation() 回答1: There are a few aspects here. I think just gridView.ScrollIntoView(gridView.SelectedItem) should work. It's a bit asynchronous, so the code wouldn't immediately see it scrolled,

How to return a build-in winrt component using WRL?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-06 11:03:12
When I create a winrt component using WRL, the problem is that I can only use ABI::Windows::xxx namespace, and I cannot use Windows::UI::Xaml::Media::Imaging namespace in WRL. Then, how to create a build-in winrt component as a return value? // idl import "inspectable.idl"; import "Windows.Foundation.idl"; import "Windows.UI.Xaml.Media.Imaging.idl"; namespace Decoder { interface IPhotoDecoder; runtimeclass PhotoDecoder; interface IPhotoDecoder : IInspectable { HRESULT Decode([in] int width, [in] int height, [out, retval] Windows.UI.Xaml.Media.Imaging.BitmapImage **ppBitmapImage); } [version

Windows 8: How to undo & redo ink using built in Inking functionality?

一个人想着一个人 提交于 2019-12-06 10:49:26
问题 I've implemented inking code in my app based on the simplified inking sample by microsoft : http://code.msdn.microsoft.com/windowsapps/Input-simplified-ink-sample-11614bbf/view/SourceCode First I made a class that saves data of an operation (draw/delete/clear) like this: public enum eInkOperation { Draw, Delete, None } public class InkOperation { public InkStroke Stroke { get; set; } //requred for drawing from undo public eInkOperation Operation { get; set; } public InkOperation(InkStroke

MediaCapture StartPreviewAsync fails

霸气de小男生 提交于 2019-12-06 10:32:26
I am trying to start video preview capture from the camera in my UWP app but StartPreviewAsync throws an exception Sample Code: MediaCapture mc = new MediaCapture(); await mc.InitializeAsync(); await mc.StartPreviewAsync(); This error occurs because currently StartPreviewAsync requires a sink to output frames to. This can be fixed by creating a capture element in xaml to display the frames. <CaptureElement Name="captureElement"/> now code can be updated to display the preview to the screen MediaCapture mc = new MediaCapture(); await mc.InitializeAsync(); captureElement.Source = mc; await mc

How does the WinRT Chrome app print without triggering the OS's “Print” dialog?

限于喜欢 提交于 2019-12-06 09:56:58
问题 How does the WinRT Chrome app print without triggering the OS's "Print" dialog? From what I've seen elsewhere, every WinRT app must go through the Windows Print dialog to print. But when you print a page from the Chrome Metro app, you get the Chrome Print dialog, and the Windows Print dialog is not triggered. 回答1: I don't think you can. The one browser app that enjoys the privilege of being your WinRT browser also enjoys special privileges not granted to other WinRT apps. For example, you can