AdaptiveTrigger and DataTemplate

Try wrapping your DataTemplate inside a UserControl like this – <DataTemplate> <UserControl> <Grid> <VisualStateManager.VisualStateGroups> … </Grid> </UserControl> </DataTemplate> Looks like any Control that has got a Content property will work. That’s why UserControl works, so does a ContentControl. So if you replace the UserControl with a ContentControl and give it an empty Style. It should … Read more

Encoding.GetEncoding can’t work in UWP app

We need to use the CodePagesEncodingProvider to register extended encodings included in that specific provider. See CodePagesEncodingProvider Class Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); Encoding.GetEncoding(“windows-1254”); Ref https://msdn.microsoft.com/en-us/library/system.text.encodingprovider(v=vs.110).aspx The .NET Framework Class Library provides one static property, P:System.Text.CodePagesEncodingProvider.Instance, that returns an EncodingProvider object that makes the full set of encodings available on the desktop .NET Framework Class Library available to .NET … Read more

How to use Acrylic Accent in Windows 10 Creators Update?

CREATOR UPDATE XAML You need to use a component that you put on the background of your app, let’s say a RelativePanel <RelativePanel Grid.Column=”0″ Grid.ColumnSpan=”2″ MinWidth=”40″ x:Name=”MainGrid” SizeChanged=”Page_SizeChanged”/> <RelativePanel Grid.Column=”0″ Width=”{Binding ElementName=MainGrid,Path=Width}” Background=”#28000000″/> <Grid> <!–Having content here, for example textblock and so on–> </Grid> The second RelativePanel is used to set the shadow color above … Read more

WinRT/UWP Frame and Page caching: How to create new page instance on Navigate() and keep the page instance on GoBack()

Because there was no solution to this problem, I had to reimplement all paging relevant classes: Page, Frame, SuspensionManager, etc… The solution can be downloaded here: https://github.com/MyToolkit/MyToolkit/wiki/Paging-Overview Update: The page class now also provides the OnNavigatingFromAsync method to show for example an async popup and cancel navigation if required…

XAML GridView ItemTemplate not binding to control

My my, look at this here: <UserControl.DataContext> <local:HabitacionControlVM/> </UserControl.DataContext> Someone sold you a bill of dirty, filthy, goods. Probably one of those jerks who run around telling people DataContext = this; is a good idea. Sorry, tangent. Now look at this: <ctr:HabitacionControl Width=”70″ Height=”140″ Ubicacion=”{Binding}”/> What is that I’m seeing? Is that a pseudo-DataContext property? … Read more

Photo capture on Windows Store App for Windows Phone

In WP8.1 Runtime (also in Silverlight) you can use MediaCapture. In short: // First you will need to initialize MediaCapture Windows.Media.Capture.MediaCapture takePhotoManager = new Windows.Media.Capture.MediaCapture(); await takePhotoManager.InitializeAsync(); If you need a preview you can use a CaptureElement: // In XAML: <CaptureElement x:Name=”PhotoPreview”/> Then in the code behind you can start/stop previewing like this: // start … Read more

How do I get a Unique Identifier for a Device within Windows 10 Universal?

That is the complete solution for Windows Desktop: Add the Extension reference “Windows Desktop Extensions for the UWP” like Peter Torr – MSFT mentioned. Use this Code to get the HardwareId: using System; using Windows.Security.ExchangeActiveSyncProvisioning; using Windows.System.Profile; namespace Tobit.Software.Device { public sealed class DeviceInfo { private static DeviceInfo _Instance; public static DeviceInfo Instance { get … Read more

Trigger element (XAML) is not supported in a UWP project

No, you don’t have Trigger support in UWP. A workaround is to use DataTriggerBehavior with a ChangePropertyAction to accomplish the exact same thing. xmlns:Interactivity=”using:Microsoft.Xaml.Interactivity” xmlns:Core=”using:Microsoft.Xaml.Interactions.Core” <Button x:Name=”MyButton” Width=”140″ Height=”80″ IsEnabled=”False”> <Image x:Name=”MyImage” Source=”Assets/xxx.jpg”> <Interactivity:Interaction.Behaviors> <Core:DataTriggerBehavior Binding=”{Binding IsEnabled, ElementName=MyButton}” Value=”False”> <Core:ChangePropertyAction TargetObject=”{Binding ElementName=MyImage}” PropertyName=”Opacity” Value=”0.5″ /> </Core:DataTriggerBehavior> </Interactivity:Interaction.Behaviors> </Image> </Button> Note that you will need to … Read more

Run Windows 10 Universal Apps on Windows 8.1

The answer would be no. For further clarifications, best to post on the forum: https://social.msdn.microsoft.com/Forums/windowsapps/en-US/home?forum=wpdevelop Windows 10 introduces several new APIs and concepts (such as API contracts) that are not available on Windows 8.1. An app that relies on such new APIs and concepts cannot run on Windows 8.1. Additionally the app-model and a lot … Read more

tech