winrt-xaml

UWP compiled binding x:Bind produces memory leaks

无人久伴 提交于 2019-12-02 20:33:18
While developing UWP application I recently found quite a few memory leaks preventing my pages from being collected by GC. I have a ContentPresenter on my page like: <ContentControl Grid.Column="0" Grid.Row="1" Content="{x:Bind ViewModel.Schedule, Mode=OneWay}"> </ContentControl> After I remove the Content, or replace it with dynamic {Binding} -- page is collected when I navigate from it. Otherwise it remains in memory. Is it bug or I'm doing something wrong? Is there a way to release and clear ALL the bindings on navigating from? UPDATE: It seems to be a known problem inside Microsoft as was

GridView- binding to groups of different ViewModels? (Combining Images and Text articles)

杀马特。学长 韩版系。学妹 提交于 2019-12-02 18:50:00
问题 I'm tying to figure out how to use the GridView with different classes for groups. In the GridApp template everything inherits from SampleDataCommon, do you always have to inherit from a common class in the GridView? The documentation seems.. lacking on this mater. UPDATE: Specifically the problem I'm trying to solve is to have a GridView with both image tiles and text news articles. 回答1: You can bind to any class type. I would suggest that they implement a common interface or class. If they

Show status bar when using the ApplicationViewBoundsMode.UseCoreWindow windows phone 8.1

痞子三分冷 提交于 2019-12-02 18:24:42
问题 My Windows Phone 8.1 apps bottom part gets under the software navigation keys. I use ApplicationViewBoundsMode.UseCoreWindow to make the page stay over the software navigation keys. But as a result the content of the page gets under the status bar and the status bar becomes transparent. Is there any way to keep the status bar normal and also make the page from going under the software navigation keys? 回答1: Is there any way to keep the status bar normal and also make the page from going under

Disable body of mail in WINRT application

依然范特西╮ 提交于 2019-12-02 17:36:58
问题 I have a date picker and time picker in my app and I'm trying to send mail as described here which contains the date as well as the time in the body of the mail. So, Now my question is how to disable the body part of the email as the user shouldn't edit the date or time once it is selected from app. What's the point of security in this ? Code: var mailto = new Uri("mailto:?to=me@mysite.com&subject=Date Selected :+datepicker.value+"); await Windows.System.Launcher.LaunchUriAsync(mailto); 回答1:

Serializing a BitmapImage in WinRT

荒凉一梦 提交于 2019-12-02 12:45:19
public static async Task SaveFileAsync(string FileName, T data) { MemoryStream memStream = new MemoryStream(); DataContractSerializer serializer = new DataContractSerializer(typeof(T)); serializer.WriteObject(memStream, data); StorageFile file = await ApplicationData.Current.LocalFolder.CreateFileAsync(FileName, CreationCollisionOption.ReplaceExisting); using (Stream stream = await file.OpenStreamForWriteAsync()) { memStream.Seek(0, SeekOrigin.Begin); await memStream.CopyToAsync(stream); await stream.FlushAsync(); } } public static async Task<T> RestoreFileAsync(string FileName) { T result =

LiveSDK 5.6.3 not working in UWP store app

 ̄綄美尐妖づ 提交于 2019-12-02 10:06:08
问题 I have a universal windows store app targeting Windows 10. In a previous version of the app targeting Windows 8.1 I used the LiveSDK (the 5.6 version here) to access data from the user's MS Live account using the LiveAuthClient . In the new version of the app, I figured I'd use the most recent version of the LiveSDK (5.6.3 available as a nuget package here) but when I install the nuget package, I am unable to to access the Microsoft.Live namespace. For example, the following statement: using

Disable body of mail in WINRT application

怎甘沉沦 提交于 2019-12-02 10:05:18
I have a date picker and time picker in my app and I'm trying to send mail as described here which contains the date as well as the time in the body of the mail. So, Now my question is how to disable the body part of the email as the user shouldn't edit the date or time once it is selected from app. What's the point of security in this ? Code: var mailto = new Uri("mailto:?to=me@mysite.com&subject=Date Selected :+datepicker.value+"); await Windows.System.Launcher.LaunchUriAsync(mailto); Damir Arh The way you decided to generate the email, you don't have any control over the email client from

GridView- binding to groups of different ViewModels? (Combining Images and Text articles)

耗尽温柔 提交于 2019-12-02 09:42:31
I'm tying to figure out how to use the GridView with different classes for groups. In the GridApp template everything inherits from SampleDataCommon, do you always have to inherit from a common class in the GridView? The documentation seems.. lacking on this mater. UPDATE: Specifically the problem I'm trying to solve is to have a GridView with both image tiles and text news articles. You can bind to any class type. I would suggest that they implement a common interface or class. If they cannot, then grouping them just does not make sense. You can display the items within the group by using a

UWP StackedLineSeries doesn't show values

蓝咒 提交于 2019-12-02 09:32:30
I am trying to use WinRTXamlToolkit.Controls.DataVisualization.UWP trying to draw any of the stacked charts like this: But only this comes out: Please help me, I have to use stacked series but the framework doesn't act as it should be.. Since I don't know how you define the code behind, I just provide the sample code as follows which can create a StackedLineSeries chart successfully. XAML Code <Page x:Class="CStackLineChat.MainPage" ... xmlns:charting="using:WinRTXamlToolkit.Controls.DataVisualization.Charting" mc:Ignorable="d"> <Grid Background="{ThemeResource

Calculate ViewBox ScaleFactor on a Metro Style App

岁酱吖の 提交于 2019-12-02 08:41:32
问题 Is there any way to get the scale factor by which a ViewBox scales its content in a XAML Windows 8 Metro Style App 回答1: The WinRTXAMLToolit has an extension for this. public static double GetChildScaleX(this Viewbox viewbox) { if (viewbox.Child == null) throw new InvalidOperationException("Can't tell effective scale of a Viewbox child for a Viewbox with no child."); var fe = viewbox.Child as FrameworkElement; if (fe == null) throw new InvalidOperationException("Can't tell effective scale of a