winrt-xaml

How to create a dialog like CameraCaptureUI.CaptureFileAsync?

那年仲夏 提交于 2019-12-12 06:30:10
问题 I would like to create a library behaving like the CaptureFileAsync method, i.e. on a method call it would open up a full screen page with standard back navigation and return result to the caller. I want to be able to call it the same way CaptureFileAsync is called: var dialog = new Library.Dialog(); var result = await dialog.Show(); In the Show method I'm currently navigating to my own page and returning a Task which can be awaited by the caller: public Task<string> Show() { var task = new

Why am I being told a class does not exist in my namespace when it does?

自闭症网瘾萝莉.ら 提交于 2019-12-12 05:57:51
问题 I am trying to follow the article here to add a custom control to my project so that I can call it ("promptForPhotosetName") like so: Popup popTart = new Popup(); popTart.Child = new promptForPhotosetName(); popTart.IsOpen = true; I added a Custom Control to my project based on Templated Control. My custom control class (which IS in the Photrax namespace) contains this constructor: public promptForPhotosetName() { this.DefaultStyleKey = typeof(promptForPhotosetName); } I have this in \Themes

XAML: Limiting size of control nested in ScrollViewer (to scroll nested within the ScrollViewer)

家住魔仙堡 提交于 2019-12-12 05:34:04
问题 I am trying to nest a user control within a ScrollViewer making its height the same as height of the ScrollViewer, which may vary based on screen size (i.e. not fixed). The ScrollViewer is responsible for horizontal scrolling and has vertical scrolling disabled. The nested user control has a grid with two rows - "header" (another user control) and a ListView. This ListView should be vertically scrollable. The objective here is that the "header" stays in place and large content of the ListView

WinRT Passing ViewModel between pages

梦想与她 提交于 2019-12-12 05:17:34
问题 I have a two page Windows 8 application. A view page and a settings page. Both pages use the same view model. I can pass the view model between pages to work with it, but then I can not save state because I have passed a complex type between pages (it has to do with how they keep references, and stops you from saving). So I guess I need to save and reload my view model on each page? I can't find a good reference on what is a best practice for this. 回答1: Usually WinRT navigates through Root

Overwrite Accent Color in App

瘦欲@ 提交于 2019-12-12 04:48:34
问题 I try to create a own design for my app. One of the main things is, that I want to replace the accent color with my own color. Now I can overwrite the brush with this: <Color x:Key="AppAccentColor">#ff6b53</Color> <SolidColorBrush x:Key="PhoneAccentBrush" Color="{StaticResource AppAccentColor}"/> Now if I assign the PhoneAccentBrush somewhere it displays the correct color. But if I click on a TextBox the Border is still the Color of the Color set in the system settings. I tried to overwrite

how to translate sign under appbar buttom

佐手、 提交于 2019-12-12 04:44:36
问题 Hello I want to localize text below standard AddAppBarButton <Style x:Key="AddAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}"> <Setter Property="AutomationProperties.AutomationId" Value="AddAppBarButton"/> <Setter Property="AutomationProperties.Name" Value="Add"/> <Setter Property="Content" Value=""/> </Style> I've tried in Resource filead add something like ButtonId.AutomationProperties.Name = value But it doesn not work. I get errors when app starts.

Creating a Byte array from an Image

天大地大妈咪最大 提交于 2019-12-12 04:43:54
问题 What is the best way to create a byte array from an Image? I have seen many methods but in WinRT none of them worked. 回答1: static class ByteArrayConverter { public static async Task<byte[]> ToByteArrayAsync(StorageFile file) { using (IRandomAccessStream stream = await file.OpenReadAsync()) { using (DataReader reader = new DataReader(stream.GetInputStreamAt(0))) { await reader.LoadAsync((uint)stream.Size); byte[] Bytes = new byte[stream.Size]; reader.ReadBytes(Bytes); return Bytes; } } } } 回答2

Retaining selected item in sublist in DataTemplate change in Windows Store Apps

柔情痞子 提交于 2019-12-12 04:17:31
问题 I have generated an expandable Listview in Windows Phone 8.1. I'm switching templates on item selection changed and item click. <ListView Name="FiltersListview" ItemContainerStyle="{StaticResource StretchItemStyle}" ItemTemplate="{StaticResource CollapsedTemplate}" SelectionChanged="FiltersListview_SelectionChanged" IsItemClickEnabled="True" ItemClick="FiltersListview_ItemClick" Grid.Row="1" Grid.ColumnSpan="2"/> <DataTemplate x:Name="CollapsedTemplate"> <Grid Height="50"> <Grid

Manipulation events of MediaElement not fire when on FullWindows mode

筅森魡賤 提交于 2019-12-12 04:08:04
问题 When I set player not in fullscreen (player.IsFullWindows = false), event work normally but when change player to full screen all manipulation event not work. Anyone have solution? <MediaElement Name="player" Margin="10,5" ManipulationCompleted="player_ManipulationCompleted" ManipulationDelta="Grid_ManipulationDelta" ManipulationMode="TranslateX" > 回答1: I can reproduce this scenario by enabling both the IsFullWindow="True" and the AreTransportControlsEnabled="True" . I think it makes sense,

Launcher.LaunchFileAsync(…) not working

做~自己de王妃 提交于 2019-12-12 03:56:59
问题 I'm working on an App for Win8 which should include the possibility of saving contact information. The service I use offers VCard support so I decided on using them. I can succesfully download and save them, only opening them automatically doesn't work. The files are "correct", and can be opened from the explorer without any problem. Any ideas why LaunchFileAsync isn't working? Here's a dump of the code: private async void SaveContactSelected() { IRandomAccessStreamReference img =