windows-runtime

Crop image with rectangle

时间秒杀一切 提交于 2019-12-08 13:37:31
问题 I have a Image and I want crop it by using a rectangle, code below is the code I put a image and draw a rectangle at middle of the image: MainPage.Xaml: <Canvas x:Name="canvas" HorizontalAlignment="Center" VerticalAlignment="Center" Width="340" Height="480" Background="Blue"> <Image x:Name="photo" HorizontalAlignment="Center" VerticalAlignment="Center" ManipulationMode="All"> <Image.RenderTransform> <CompositeTransform/> </Image.RenderTransform> </Image> <Path Stroke="Black" StrokeThickness=

How to get method name from Action in WinRT

感情迁移 提交于 2019-12-08 12:54:36
问题 I'm trying to get the method name from an Action in WinRT, where Action.Method is not available. So far I have this: public class Test2 { public static Action<int> TestDelegate { get; set; } private static string GetMethodName(Expression<Action<int>> e) { Debug.WriteLine("e.Body.NodeType is {0}", e.Body.NodeType); MethodCallExpression mce = e.Body as MethodCallExpression; if (mce != null) { return mce.Method.Name; } return "ERROR"; } public static void PrintInt(int x) { Debug.WriteLine("int

Windows 8 Javascript app activation/launch deferral

情到浓时终转凉″ 提交于 2019-12-08 12:09:54
问题 So currently in a windows 8 WinJS app I'm coding, I am trying to get the loading of an xml file to take place in the app startup sequence, while the splash screen is still showing, as this xmldoc element is needed for when the home page loads, and loading of the home page will fail without it. This is my initiation sequence in default.js: (function () { "use strict"; var activation = Windows.ApplicationModel.Activation; var app = WinJS.Application; var nav = WinJS.Navigation; var sched =

Nuget Resolve dependencies from local files

混江龙づ霸主 提交于 2019-12-08 11:58:35
问题 I have a solution with four projects, three PCL and one WinRT. I've managed to create a nuget package for each one, individually, however, I want to do a single package for all of them, but there are external dependencies and also dependencies between them and I do not know how to resolve them. What I found for external dependencies is something of the like: <?xml version="1.0"?> (...) <dependencies> <dependency id="SampleDependency" version="1.0" /> </dependencies> (...) </package> But how

How to serialize and deserliaze a Dictionary<string,object> in WinRT (Metro app in C# and XAML)?

冷暖自知 提交于 2019-12-08 11:52:15
问题 I've been trying to solve this silly problem for a few days now and it is doing my head in. I would be very happy is somebody has a working example, because the ones I have found so far did not work :( I can serialize basic types, but not objects. And I am very confused in regards to the DataContractAttribute etc. The error I get is: {"Type 'SerializeListWinRT.DataModel.LocalStorage+Cat' with data contract name 'LocalStorage.Cat:http://schemas.datacontract.org/2004/07/SerializeListWinRT

detecting hold event in webview on windows phone 8.1

丶灬走出姿态 提交于 2019-12-08 11:19:04
问题 I'm currently working on a web browser app mainly targeting win rt in Windows phone 8.1. I'm now trying to figure out how to detect the hold event when a user holds down a link or image in webview and display a context menu. How would I go about doing this? How would I detect the event in wp8.1? I know I'll have to invoke script but what is the c# to detect the event? Thanks :) 回答1: Did you try using the Holding event attribute of the UI element? http://msdn.microsoft.com/en-US/library

Launching the Windows Store listing from Win RT / Windows 8 app

◇◆丶佛笑我妖孽 提交于 2019-12-08 11:16:34
On Windows Phone there's a marketplace review task. Is there any way to implement the equivalent functionality in WinRT apps? I realize that there's the "rate and review" button in the Charms bar, however, this is not what I need, as I want to integrate a button inside the app to launch the review UI. It may seem trivial, however, this is one of the most important requirements! This is not a duplicate of is there an equivalent of wp7's marketplacereviewtask for windows 8 / winrt / metro style? because the questioner was happy with the Charms bar method. thanks This can be done in C# this way:

How to get an enumeration value when using IMetadataImport

让人想犯罪 __ 提交于 2019-12-08 10:49:11
问题 Short version How to you get the numeric value associated with an enum from a *.winmd file when using IMetadataImport ? A good example is ApplicationHighContrastAdjustment enumeration: //Windows.UI.Xaml.ApplicationContrastMode (@020000006) public enum ApplicationHighContrastAdjustment : uint { None = 0u, Auto = 4294967295u } Most enumerations are 0, 1, 2, ... . But this one has other values specified on the enum members: 0 4294967295 How do i read get those UInt32 values Note : The question

How to get the image already inside a RichEditBox in UWP

谁说胖子不能爱 提交于 2019-12-08 10:43:45
问题 I have a RichEditBox in UWP with an image already inserted inside. When the image was inserted it was given a certain width and height (in pixels). Now, after the image has been inserted, I would like to select the image and edit the dimensions. Is there any way to achieve this? Also, I have seen a similar thread that has an incorrect answer. Please remember this is for WINRT (UWP). How to get image from RichEditBox 回答1: I would like to select the image and edit the dimensions Firstly, you

Insert list in RichEditBox for Windows store application

那年仲夏 提交于 2019-12-08 10:04:31
问题 I develop text editor for the Windows store application (WinRT) based on RichEditBox control. RichEditBox use ITextParagraphFormat for paragraph operation and ListAlignment, ListLevelIndex and other properties for bulleted and numbered lists. I not found any samples to insert bulleted or numbered lists to RichEditBox. How I can to add lists to RichEditBox using ITextParagraphFormat? 回答1: You need to set the ITextParagraphFormat.ListType property for the ITextParagraphFormat. For bullet, set