winrt-xaml

Clipping a low resolution image using Transforms and assigning it to my user control

假如想象 提交于 2019-12-05 03:32:53
I have been working on a Windows 8.1 RT app where the user loads an image with Stretch=Uniform . The image can be as small as possible and as big as possible. The clipping happens in my user control and my user control appears when I tap/press and hold on the screen/image. Clipping happens when when I tap and hold and move my finger/mouse around the image that is in the background. The Problems I am facing are Whenever the app is loaded for the first time on Emulator , and for the very first time when the tap /clicks and holding is performed , the user control appears on the top left on the

How can i bind a button in listviewitem to a Command in ViewModel in Winrt

六月ゝ 毕业季﹏ 提交于 2019-12-05 03:09:11
I have a NavigateToAccountsCommand RelayCommand property in the ViewModel. When I bind the same to a button on the page anywhere outside the ListView the command binding is working. However as soon as I move this to a ListView's DataTemplate its not working. I have tried changing the binding from NavigateToAccountsCommand to DataContext.NavigateToAccountsCommand still not working. Appreciate your help... <Page x:Class="FinancePRO.App.Views.AccountsView" DataContext="{Binding AccountsViewModel, Source={StaticResource MainViewModelLocator}}" mc:Ignorable="d"> <Grid> <!--**This one is working**--

Why do my images sometimes reload (and WriteableBitmaps disappear) on resume?

房东的猫 提交于 2019-12-05 01:05:41
问题 When I resume my app, sometimes it loses its images. I can reproduce this even in trivial apps. This manifests in two different ways, depending on where the image came from: If I did something like <Image Source="/Assets/Logo.png"/> (i.e., loading an image from my app package by URI), the image will disappear briefly, and then reload. This is easier to see when the screen contains many images; they reload in sequence, so I can watch the image loading ripple across the screen. If I created a

Open links in external browser in WebView (WinRT)

▼魔方 西西 提交于 2019-12-05 00:45:13
I have a WebView component that I use to display HTML Ads in my app. When user clicks an Ad in the WebView I want to open the Ad link in an external browser. How do I do that? I need something like OnNavigating from the WP7 browser. I tried the Tapped event of the WebView but it never gets called even when I set IsTapEnabled=true. I need something like You will need to use the ScriptNotify event for this. Here's how I handled the scenario (using NavigateToString). If you're retrieving the web view content from a URL, you will need be able to modify the HTML for this to work. Add the following

How to Know When a FrameworkElement Has Been Totally Rendered?

我与影子孤独终老i 提交于 2019-12-04 23:22:37
问题 For WPF there is the ContentRendered event in the Window class which let us know when the visual elements have been rendered. Is there anything that would help me achieve the same result for UWP apps? I'd like know when a FrameworkElement has been completely rendered so I can trigger some actions after that. I don't think the Loaded event helps on that since it's triggered way before there's anything on screen. 回答1: I would start with Loaded. It might be better than you think. https://msdn

Page constructor gets called again when navigating back in Windows 8 C# App

孤人 提交于 2019-12-04 22:54:32
问题 I have found that in Windows 8 apps, a Page's constructor always gets called again when navigating back to this page, however this is not the case in Windows Phone 7 apps. Because of this behavior all the properties of that page get lost and you need to somehow store them and reassign them after the page is reactivated. At the moment I am using the SaveState method to save the data and reassign the data in LoadState method. Both of the methods are built-in in the sample Grid/Split App. I

Crop image with dynamic rectangle coordinate

这一生的挚爱 提交于 2019-12-04 22:48:42
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="1"> <Path.Data> <RectangleGeometry Rect="0,0,340,480"/> </Path.Data> </Path> </Canvas> I able to move

How to build a SQLite Query to handle string containing an apostrophe

↘锁芯ラ 提交于 2019-12-04 21:41:08
If the string company contains an apostrophe, this will cause an error. Example: Company name like "William's store" . How to build an SQLite Query that will handle this kind of problem using SQLite-Net api. I am using SQLite-Net api and I tried both and they did not work. In SQLite-Net api, I think there is no Parameters. What other alternative that I can use? private async void GetCustomerVATGroup(string Company) { 1) string strChkName = Company.Replace("'", "''"); // or Company.Replace("'","\'"); var allUsers = await db.QueryAsync<Customer>( "Select * From Customer Where CompanyName ='" +

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

谁说我不能喝 提交于 2019-12-04 18:48:36
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 ? You can set the ItemsStackPanel's ItemUpdatingScrollMode. <ListView> <ListView.ItemsPanel> <ItemsPanelTemplate> <ItemsStackPanel ItemsUpdatingScrollMode="KeepScrollOffset" /> </ItemsPanelTemplate> </ListView.ItemsPanel> </ListView> It only works when the scroll offset is greater than 0, so just scroll using ChangeView() to set it up. 来源: https:/

Color of startscreen in Windows 8 through Metro DynamicResource?

偶尔善良 提交于 2019-12-04 18:22:07
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. There is no API available to use the currently selected Windows theme color. Yes, no API unluckily. What about this workaround? http://blog.quppa.net/2013/01/02/retrieving