winrt-xaml

Crop image with dynamic rectangle coordinate

此生再无相见时 提交于 2019-12-06 15:22:00
问题 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=

What is the equivalent of an app.config in a WinRT app?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-06 13:37:40
In windows desktop development (WinForms, WPF), the app.config is a potential place to put things like connection strings or uri's used within the app. This allows the end user to change these settings, application wide, without having to have a developer rebuild and redeploy. Is there a similar concept in WinRT apps? The closest thing I see is there is the local application data: http://msdn.microsoft.com/en-us/library/windows/apps/hh700361.aspx The trouble I am having is that it seems like creating values and setting values in local application data are all done within code. Is there a way

Color of startscreen in Windows 8 through Metro DynamicResource?

筅森魡賤 提交于 2019-12-06 13:16:44
问题 I've looked through Generic.xaml and ThemeResources.xaml in the following path: C:\Program Files (x86)\Windows Kits\8.0\Include\WinRT\Xaml\Design However, they don't seem to contain a resource key that I can use in order to retrieve the color of the current scheme selected in the Windows 8 start screen. The color I am trying to retrieve through a DynamicResource in the XAML is seen visually below, to demonstrate my point. 回答1: There is no API available to use the currently selected Windows

How to use WriteableBitmap.setpixel() efficiently in windows 10 uwp?

佐手、 提交于 2019-12-06 12:43:30
问题 I have a scenario where choosing a image file and then using BitmapDecoder converting the source to a WriteableBitmap and setting an image.source to the WriteableBitmap. Now when a user taps on the image I get the co-ordinates and then want to color the entire region surrounding that pixel with a particular color.(Like the fill option in paint). The code I've used is private void setPixelColors(int xCord, int yCord, int newColor) { Color color = bit.GetPixel(xCord, yCord); if (color.R <= 5 &&

Prevent the listview from scrolling to its top position when ItemSource changed Windows 8.1

荒凉一梦 提交于 2019-12-06 12:37:13
问题 So is there a way to stop scrolling up ? I have listview's scrollview and i tryed saving last position and in listview size changed scroll down - but it first scrolls down and later up ;/ Maybe there is some different event or completly different way ? 回答1: You can set the ItemsStackPanel's ItemUpdatingScrollMode. <ListView> <ListView.ItemsPanel> <ItemsPanelTemplate> <ItemsStackPanel ItemsUpdatingScrollMode="KeepScrollOffset" /> </ItemsPanelTemplate> </ListView.ItemsPanel> </ListView> It only

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

Caliburn Micro : passing Object between ViewModel

牧云@^-^@ 提交于 2019-12-06 11:51:19
I'm developing a simple Crud Application (a windows 8.1 store application) using Caliburn Micro 2.0.0-alpha2 I'm in trouble with navigation between viewmodels, passing object. I read many times the solution proposed by Anders Gustafsson ( How to pass parameter to navigated view model with WinRT Caliburn.Micro? ) and i tried to adapt it to my scope. But the object is alwais null. I need to pass a single object selected from a listView to my crudPage. The crudPage is composed by an userControl that shown the FormView. So i want to initialize this Form, with the values of the passed object. I

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

Cannot get Facebook single signon with windows 8.1 to work

二次信任 提交于 2019-12-06 11:36:25
问题 After the great news about Facebook and Microsoft support Facebook SSO I have tried to implement this in a winrt/xaml/c# app for windows 8.1, however I cannot get it to work. I have registered the app with facebook and set the app's SID in the app's settings. This is the login code: Uri sid = WebAuthenticationBroker.GetCurrentApplicationCallbackUri(); string callbackURL = sid.ToString(); String facebookURL = "https://www.facebook.com/dialog/oauth?client_id=" + Uri.EscapeDataString(AppId) + "