FAQ Database Discussion Community


How to set specific ThemeResource for Image control through binding with MVVM?

c#,xaml,mvvm,windows-phone-8.1,winrt-xaml
I have an app in which I have defined multiple ThemeResources to set the correct Source for multiple images that I would like to use. I have about a dozen Images for which I can let the app automatically set the Light or Dark theme as required. <ResourceDictionary> <ResourceDictionary.ThemeDictionaries> <ResourceDictionary...

How powerful is winRT?

windows-runtime,microsoft-metro,winrt-xaml,photoshop
EDIT: So apparently the last attempt at this question was to open ended. Allow me to try again: So I've been thinking about Microsoft's 'One Windows' vision, and I am wondering... how powerful could WinRT really be? If someone was to target only PC systems and not phones or tablets,...

How to align image content on stackpanel in metro app

winrt-xaml,stackpanel
I've got a Stackpanel which is set to horizontal orientation and Horizontal alighment is set to Stretch. Inside it I've got two elements: 1. TextBlocks 2. Image. I want the 2nd one to display on extreme right. <StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch"> <TextBlock>Hello World</TextBlock> <Image Height="100" Width="100" /> </StackPanel> How do I...

Cant get twoWay Binding from Xaml to ObservableCollection Working

c#,binding,windows-store-apps,winrt-xaml,inotifypropertychanged
Im attempting to bind a gridView to a ObservableCollection in a Windows Store App. My problem is I get the data but the set does not seem to work public class ValveData : INotifyPropertyChanged { private string valveName; private decimal waterMl; private decimal waterEc; private decimal waterPh; public string ValveName...

Append extra text to a bound textblock in winrt universal application

c#,binding,windows-phone-8.1,winrt-xaml
<TextBlock Text="{Binding Amount}" /> I have this text block, it simply shows a number what ever I bind. What I want is that it could append 'AED' before the bindings. Mean if 4.00 is bound, it would show this: AED 4.00 If I don't want to create another textblock and...

Flipview doesn't maintain selectedindex after returning from mail app via launcher

c#,xaml,windows-phone,windows-phone-8.1,winrt-xaml
I am facing an issue with FlipView. I am sharing the minimalistic project, which represent my usecase in original app, http://1drv.ms/163kHCR. I have two pages. First is MainPage.xaml. It has a flipview with five times. First four has just textblock and fifth one has one button. Clicking on it I...

How to handle mutiple async methods from running?

c#,asynchronous,windows-store-apps,winrt-xaml,winrt-async
How can i know if an async(awaitable) operation is already running and waiting for completion in the application. I have two buttons in a view each binded to two differrent async methods. If button1 is clicked and the async is started and waiting for its result. And at that time...

Comparing Button.Background with Colors

c#,xaml,winrt-xaml
I am building a Windows Store application. I am facing a problem when trying to compare the background with a color. What My Program Does. There are many buttons on the screen and on a click of any button it changes the background color of it to either red or...

Accomodate custom item on winrt listview

c#,listview,windows-runtime,winrt-xaml
I'm developing windows metro app. In my application, I've one Listview with wrapgrid in itemspanel to display list of items on vertical rows with specific height. I want to display one item on top of the first column of list view, which shows result/stats of list items. I would like...

The path (ImageSource) in WinRT to display an image that is saved in Pictures folder (not in app packages)

xaml,windows-runtime,winrt-xaml
So, i've saved my image in StorageFile picture = await KnownFolders.PicturesLibrary.CreateFileAsync(filename, CreationCollisionOption.ReplaceExisting); and i want to display it in XAML : <Image Grid.Row="1" Grid.Column="0" x:Name="Photo" Source="ms-appx:///Pictures/test.png" VerticalAlignment="Center" HorizontalAlignment="Left" Stretch="Fill" Width="1024" Height="768"> </Image> and it's not working :( Thank you very much for you help :)...

Clipping Using Rectangle Geometry in WinRT application

c#,winrt-xaml,rectangles,windows-rt
I was previosuly using WriteableBitmapEX library for cropping images whereever my mouse moves. It seems to be a bit slow. I want to crop the image at any random pixels and I want to asssign that cropped region to another image control . My problem is when I am using...

Binding on XAML Popup's Opened Event

xaml,winrt-xaml
I need to run some logic every time a Popup element is shown (due to dynamic size of its contents and, in my case, the position of the popup). The following XAML and handler do not work, although they are ripped directly from the docs: <Popup x:Name="Foo" Opened="Foo_Opened"> ... </Popup>...

WinRT how to not have page go up when virtual key board appears Windows Phone 8.1

c#,xaml,windows-phone-8.1,winrt-xaml
I have an AutoSuggestBox in a XAML Page for a Windows Phone 8.1 app and when i click on the AutoSuggestBox the whole page goes up. Does anyone know how to disable this feature? Thanks Edit: Here is the code fix, thank you Peter Torr - MSFT. Windows.UI.ViewManagement.InputPane.GetForCurrentView().Showing += (s,...

Can't add a using statement in View in universal phone app

windows-phone-8.1,winrt-xaml,win-universal-app
We had a phone app in windows 8.0. Recently we started on migrating our app to 8.1. Found out we should use Universal apps instead of silverlight if we want certain features like background audio player. When doing so my current problem is that I can't add reference in my...

Development trends of Business apps in WPF now a days

wpf,winrt-xaml
I have asked this question several time form many developers about the future of WPF in 2015 and in coming years. Someone told me that Microsoft is interested to take this technology in the future also. Actually i like to develop enterprise and LOB business application in Winforms and now...

Windows 8.1 how to dismiss a SettingsFlyout programmatically

winrt-xaml,windows-8.1
I have a Windows 8.1 application. In that I have a SettingsFlyout in ShowIndependent mode. Inside the settings flyout I have a List I want the SettingsFlyout to dismiss on click of any item in the list. I would be very glad if someone can point me in the right...

Close Flyout which contains a UserControl

windows-runtime,windows-store-apps,winrt-xaml
I am building a user control for a TextBox because I want it to have some special behaviour. The control can be used in several contexts, including as a flyout for a button. When it is a flyout I want to close the flyout when the user presses the Enter...

ResolutionScale vs RawPixelsPerViewPixel on Windows Phone 8.1

windows-phone-8.1,winrt-xaml,windows-8.1
I'm currently working on a universal Windows 8.1 / Windows Phone 8.1 application, and am trying to make sense of the various types of display information that's being presented to me. For Windows Phone, we have access to two different properties in the DisplayInformationClass: ResolutionScale RawPixelsPerViewPixels ResolutionScale seems to only...

Bind an Action to a property of a UserControl in XAML

windows-runtime,winrt-xaml
I have a user control which has a button and a dependency property for the action the button is to execute. The page which contains the control sets the action in XAML. MyUserControl.cs A Button, and dependency property ButtonAction, of type Action. When the button is clicked it executes the...

Cropping Image with Xamlcropcontrol for UI and WriteableBitmapEx

c#,windows-store-apps,winrt-xaml,writeablebitmapex
For the past week I've been researching as much as i can on how to add the ability to crop a profile image in my windows store app. So far I have looked at the Microsoft solution to this but have decided to go a different route. I downloaded a...

How to use RichEditBox to provide formatted text

xaml,windows-phone-8.1,winrt-xaml,c++-cx,richeditbox
According to Microsoft's Quickstart: adding text input and editing controls, I should use RichEditBox should I want to provide some kind of formatted text editor. Unfortunately, they have been so thrift in examples. The examples provided only shows how to load RTF files for displaying. It tells nothing of how...

Multiple item template inside grid view in Windows 8.1 store app

c#,xaml,windows-store-apps,winrt-xaml,windows-8.1
In a gridview item template , is it possible to have multiple templates ? In my screen i am having set of icons in a single section of GridView control. I wqant to have one of the icon to have a larger dimension. How can i achive it. <GridView> <GridView.ItemTemplate>...

MultiBinding(WPF) alternative for Windows Store Apps

windows-runtime,windows-store-apps,winrt-xaml
I am developing a Windows Store App which displays fields of specific types throughout the App and allows the user to change their preference of units for display of that type of field. Using an example of fields related to Heights, if using MultiBinding from WPF (not available in WinRT)...

Windows phone 8 app bar command parameter always null - Cimbalino

windows-phone,winrt-xaml,mvvm-light,windows-phone-toolkit,cimbalino
Xaml Namespaces xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit" xmlns:interactivity="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" xmlns:appBar="clr-namespace:Cimbalino.Phone.Toolkit.Behaviors;assembly=Cimbalino.Phone.Toolkit" xmlns:cmd="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.WP8" <!--LayoutRoot is the root grid where all page content is placed--> <Grid x:Name="LayoutRoot"...

Remove Combobox winrt flayout heading

combobox,windows-runtime,styles,winrt-xaml
In winrt windows phone app when you have more than 5 items in a combobox, it opens up on a full screen. And on top its written 'Choose an item'. I want to remove this heading from all my combo boxes....

Styling Windows Phone 8.1/WinRT AppBarButton

windows-runtime,windows-phone-8.1,winrt-xaml,windows-8.1
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...

WinRT control to render XAML UIElement

c#,xaml,windows-runtime,winrt-xaml
I am porting a WPF app into WinRT. The old app had a part where it would take something like an Image, MediaElement, a Xaml Page, etc; cast it as a UIElement; and then the recieving class would use VisualBrush to render it onto a button. Unfortunately WinRT has no...

Fill ViewBox completely with part of image area determined by Image.Clip

c#,image,xaml,windows-phone-8.1,winrt-xaml
I have a large image I want to use within an Windows Phone 8.1 app. For the purpose of my application I want to show only a certain part of the image and want to fill the complete ViewBox with that specific part. I can easily get the specific part...

Setting x:DeferLoadStrategy in code behind

xaml,windows-runtime,winrt-xaml,windows-universal,windows-10
In Windows 10, we have a new way of deferring xaml rendering by setting x:DeferLoadStrategy="Lazy" in xaml. However, I failed to find any document indicating how to achieve the same thing in code-behind. The reason that I want this is that I need to somehow hide the element completely again...

binding height/width to child element in XAML

c#,xaml,winrt-xaml,windows-8.1
Let me start by saying sorry if this is a duplicate. I was unable to find an answer in any of the similar posts that I have read. I am having an issue where I have a Border control whose Height and Width are bound to the ActualHeight and ActualWidth...

How to display UIElement but without UI interactions (to touches, clicks, …)

windows-runtime,winrt-xaml
I would like to add some kind of watermark over a page in my application : The watermark is a UIElement (a Canvas for instance with partial opacity) which is on top of all others controls. And I want it to be "transparent" to any touches/clicks/gestures. As "transparent", I mean...

An AppBarButton is randomly fired after the App is compiled for releasing

c#,windows-runtime,windows-phone-8.1,winrt-xaml
I'm developing a new App with VS 2013 for Windows Phone 8.1 (WinRT) and I'm getting desperate that sometimes works and sometimes doesn't work. I need to compile N times the same project to make that one element works. This is my code. XAML: <Page.BottomAppBar> <CommandBar x:Name="appBar"> <AppBarButton x:Name="btnNew" Icon="Add"...

What is the best event handler for long running code after a page is loaded for Windows Phone 8.1?

c#,xaml,windows-runtime,windows-phone-8.1,winrt-xaml
I have long running code that hits our server for updated information. I want it to load AFTER the page is loaded and usable by the user. I tried putting this code in the OnNavigatedTo() method of the page and the Loaded event of the page but the page UI...

Selective coloring of the text in TextBox (Windows Store App)

c#,textbox,windows-store-apps,winrt-xaml,text-coloring
Code in my MainPage.xaml <TextBox x:Name="TextTextBox" Text="{Binding Path=Text, Mode=TwoWay}" TextWrapping="Wrap" /> . . . <!--Button with some Command--> <Button x:Name="SearchButton" Content="Search" HorizontalAlignment="Center" Command="{Binding Command}"/> Code in my ViewModel (property that is binded with TextBox) public string Text { get { return ssModel.Text; } set { ssModel.Text = value; OnPropertyChanged(); }...

Remove blank space from Pivot Item in Windows Phone 8.1 App

xaml,windows-phone-8.1,winrt-xaml
How to get rid of the blank space between a pivots item and the pivots borders? I tried setting the margin and the padding to 0 but it does not help much. The reason I want to do this is the following - I figured that changing the template of...

Collapse HubSection programmatically crashes - WP8 C++

c++,windows-phone-8,winrt-xaml
I'm trying to set the visibility of a HubSection to Collapsed but my when I'm doing it my app crashes with the following error. accountSection->Visibility = Windows::UI::Xaml::Visibility::Collapsed; // Executed on the main thread. Error Message: The parameter is incorrect. Could anyone help me? Thanks...

ListView with column on the right on a Windows Phone 8.1 app

windows-phone-8.1,winrt-xaml
i have a problem with a ListView and i have no idea how to solve it without hardcoding a width: I have this listView: <ListView Name="lstStates" CommonNavigationTransitionInfo.IsStaggerElement="True" ContinuumNavigationTransitionInfo.ExitElementContainer="True" IsItemClickEnabled="True" ItemClick="lstStates_ItemClick" ItemsSource="{Binding States}" HorizontalAlignment="Stretch" > <ListView.ItemTemplate> <DataTemplate> <Grid Margin="8" Background="AliceBlue" HorizontalAlignment="Stretch">...

Programming wpf xaml vs windows rt with c# and xaml

winrt-xaml
Ok. I know wpf and am learning programming windows runtime via c# and xaml. Both use xaml that have the same namespace. Win rt is new and has the same namespace declared at the root element. What are the similarities and differences....

Send a key to WebView

c#,xaml,windows-phone-8,windows-runtime,winrt-xaml
Short Version: Is it possible to send a key press event to an embedded WebView in Windows Phone? Long Version: I have a simple HTML5 game hosted on a website and now I want to load it inside a WebSite in a Windows Phone app and then add control keys...

Tile Image not shown

windows,windows-phone-8.1,winrt-xaml,live-tile
I try to set my main tile with the templatew TileWide310x150SmallImageAndText02. I had a look at the sample code and took this out of it: ITileSquare310x310SmallImagesAndTextList04 tileContent = TileContentFactory.CreateTileSquare310x310SmallImagesAndTextList04(); tileContent.Image1.Src = "ms-appx:///Assets/Logo.png"; tileContent.TextHeading1.Text = "Cashflow"; tileContent.TextWrap1.Text = "Income: 500"; tileContent.TextWrap2.Text = "Spending: 400"; tileContent.TextWrap3.Text = "Earnings: 200"; // Create a...

How to animate HubSection when visibility changed in WinRT Hub Control

xaml,animation,windows-runtime,winrt-xaml
I have a HubSection that is dynamically shown/hidden using Visibility Collapsed/Visible during runtime. I would like to animate the HubSection by having it expand and shrink instead of just instantly showing or hiding it. Animations in WinRT tend to be a science, and I haven't found a good method yet....

How to bind a textblock visibility to another textblock text property

c#,xaml,windows-phone-8,windows-phone-8.1,winrt-xaml
<Grid Height="{Binding ElementName=oldPrice, Path=Height}"> <TextBlock VerticalAlignment="Bottom" FontSize="{StaticResource TextStyleSmallFontSize}" RequestedTheme="Light" FontWeight="Bold" Foreground="#B0B0B0" Style="{StaticResource TitleTextBlockStyle}" TextWrapping="NoWrap"> <Run x:Name="oldPrice" Text="{Binding oldPrice}" /> </TextBlock> <Line Stretch="Fill" Stroke="#B0B0B0" StrokeThickness="1" X1="1" Width="{Binding ElementName=oldPrice, Path=Width}" Height="{Binding ElementName=oldPrice,...

Fit element width of current screensize in an universal app

xaml,windows-phone,winrt-xaml,windows-universal,windows-10
I'm trying to develop an app for Windows 10. But with the all new screensizing I can't seem to figure out how to get an element to fit to the current size of a device screen. For example I want a TextBlock to fit the width of the window if...

Windows Store App - Dynamic Binding

c#,windows,windows-store-apps,winrt-xaml
Need a second set of eyes. I am dynamically populating a hub control with text boxes, check boxes, etc... As I do this I am adding databinding to each control as I add it. The problem is that any changes made after the load event are not registering properly. Basically...

WebView in FlipViewItem - WebView does not accept any gestures

windows-phone-8.1,winrt-xaml
I've put a WebView inside of a FlipViewItem. The problem seems to be that in WP 8.1, the WebView does not get the gestures (presumably because they're absorbed by the FlipView). The desired result is to be able to scroll vertically and tap in the WebView but also to be...

Semantic zoom - tap item to navigate to specific page

c#,winrt-xaml
How can I get my app to navigate to a specific page based on the item within the semantic zoom that was tapped? Each item has a link to its own page and I want to use the 'item.Link' element so that the app reads the link and uses it...

Data Binding ObservableCollections with an IoC

c#,windows-runtime,winrt-xaml
I am writing a Universal app targeting Windows 8.1, and am re-writing it to use an IoC container. However, I found something that is puzzling me a bit. Before I used the IoC, I would create an instance of my VM in the code-behind and bind to it, like this:...

Caliburn.Micro attach event handler on event of Behavior

c#,xaml,winrt-xaml,caliburn.micro,behavior
I wrote my own Behavior to handle a swipe gesture and put it to the ItemTemplate of a ListView. If a swipe is completed, I raise an event for LeftSwipe or RightSwipe. This event should be handled by my ViewModel. I use the syntax of Caliburn.Micro to attach handler to...

Local settings in Windows Phone 8.1 app are not stored

c#,windows-runtime,windows-phone-8.1,winrt-xaml
I have created many apps for Windows Phone 7 and 8. To store settings I was using these methods: IsolatedStorageSettings.ApplicationSettings["key"] = value; IsolatedStorageSettings.ApplicationSettings.Save(); Everything worked perfectly, my settings were stored. Save() method did the job. But now I am creating an app for Windows Phone 8.1 (WinRT). I have followed...

Multiple ListView UI Virtualization

listview,windows-phone-8.1,winrt-xaml
I have something like the following code: <ScrollViewer> <Grid> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> </Grid.RowDefinitions> <ListView ItemsSource="{Binding FewItems}" /> <ListView ItemsSource="{Binding ManyItems}" Grid.Row="1" /> </Grid> </ScrollViewer> My problem is the second list, which is very large. Normally, UI Virtualization would take place, but since it's defined inside a...

Errors in Generated Files for WinRT XAML DirectX Universal App

c++,visual-c++,windows-runtime,windows-store-apps,winrt-xaml
I started a project from the DirectX and XAML template and made some small edits to the Direct3D-only portion of the project. Now I get a number of errors in the xamltypeinfo.g.cpp file, stating that the Common::NavigationHelper class doesn't exist. Hovever I can validate that it's definitely a class included...

ListView swipe/slide animation

listview,animation,windows-runtime,winrt-xaml,swipe
I have a ListView control to display items and I want provide a swipe/slide gesture to select an item. I use the GestureRecognizer class to recognize the cross slide gesture but I also want to animate this gesture by moving the seelcted item horizontally. For example, this should look like...

Set ZoomFactor when page loads

c#,xaml,winrt-xaml,windows-rt
How can I set the ZoomFactor of my image using the OnNavigatedTo method? I've tried using this code but it doesn't work. protected override void OnNavigatedTo(NavigationEventArgs e) { navigationHelper.OnNavigatedTo(e); imageHolder.ZoomFactor(0.1); } hence I get this error: Non-invocable member 'Windows.UI.Xaml.Controls.ScrollViewer.ZoomFactor' cannot be used like a method. ...

Binding property of usercontrol to data

c#,xaml,mvvm,binding,winrt-xaml
I'm not sure of the correct terminology to use. I created a Windows Store app about a year ago and the main page was created by Visual Studio and I never changed it much. It uses a view model that works fine but I don't know enough to fix problems....

Win8/RT Using a custom (.ttf) font

c#,xaml,windows-8,windows-store-apps,winrt-xaml
I'm using this code in a Grid inside a Page to make my TextBlock use a custom font from /fonts/pirulen rg.ttf. <TextBlock HorizontalAlignment="Left" Margin="617,49,0,0" Text="I Am the New Font" FontFamily="fonts/pirulen rg.ttf#Pirulen Rg" /> The font style is recognized when this Textblock is opened in the Property editor, but not so...

WinRT-xaml-Toolkit: Line Series with median Line

xaml,windows-store-apps,winrt-xaml,silverlight-toolkit,winrt-xaml-toolkit
Is there a way to implement a median Line using this lib? The only way I think could work is adding a new LineSeries and add a median for each Value in my Data-LineSeries Something like this: <charting:Chart> <charting:Chart.Series > <charting:LineSeries ItemsSource="{Binding Articles}" Title="Test Title" Height="400" Width="400" IndependentValuePath="dateTime" DependentValuePath="price" >...

Refresh binding with converter bound to other property

c#,windows-runtime,winrt-xaml,windows-10
I am currently building a WinRT app for Windows 10 and I am facing an issue I can't seem to find an answer for. In my main page, I have a list of map markers bound to an ObservableCollection in my ViewModel. For each of these markers, i need to...

Two Textblocks in same row

winrt-xaml
In stackpanel, I want two textblocks in same row. in the image, I want the date and time at the same row. what should I do? Following is source code: <StackPanel VerticalAlignment="Bottom" Background="{ThemeResource ListViewItemOverlayBackgroundThemeBrush}"> <TextBlock Text="{Binding Title}" Margin="15,0,15,0"/> <TextBlock Text="2015/03/01" Margin="15,0,15,10" HorizontalAlignment="Left"/> <TextBlock Text="1:42:31" Margin="15,0,15,10" HorizontalAlignment="Right"/> </StackPanel> ...

Animate zoom factor programmatic in a ScrollViewer

c#,gridview,windows-runtime,storyboard,winrt-xaml
Is there a way that I can animate changing the zoom factor of a ScrollViewer for Windows Runtime? I'd like to be able to have an image inside one respond to a tapped event by returning to a default zoom of 1. While it seems that in Windows 8.1 Change...

How do I make my TextBlocks be the correct sizes in my C# XAML Windows 8.1 app?

c#,xaml,windows-phone-8.1,winrt-xaml,windows-8.1
I'm new to Windows 8.1 development, so forgive me if this question is obvious or rudimentary. I've experimented around with the various attributes quite a bit, and I can't make it work the way I want it to, so I figured maybe someone here could give me a hand. A...

WinRT XAML Toolkit TreeView expanded display

winrt-xaml
I am developing a Windows store app. At a high level, the page has a Grid with two rows. Along with other controls, the ComboBox is placed in the first row. The second row has a GridView and the red tile is one of the items in the GridView. The...

Cant use ItemTemplateSelector with Flipview

c#,xaml,windows-phone-8.1,winrt-xaml,winrt-xaml-toolkit
I am trying to use an ItemTemplateSelector with a Flipview the same way i would use an ItemTemplateSelector with a Listview but it does not work and i cant find any examples on how to use one with a Flipview. Here is my XAML: <Page.Resources> <DataTemplate x:Key="textview"> <TextBlock Text="{Binding textstring}"...

How to register event for TextBox end editing

c#,events,winrt-xaml
Super newbie to C# (first day coding), so please don't judge me too much if the following is really a stupid question to you. But I am looking for a way to register an event for when a TextBox end editing, which is similar textFieldDidEndEditing(_ textField: UITextField) delegate in iOS....

Windows Store Browse Button

xaml,winrt-xaml
I want to create a simple Browse button like that found on the Windows 8.1 Reader app: However, after searching for an hour I'm still no wiser. There must be a standard Button style for circle buttons? And where would I find the browse icon?...

Pivot with multiple Header items and a single PivotItem

c#,windows-runtime,windows-phone,windows-phone-8.1,winrt-xaml
Is it somehow possible to create a Pivot with a single PivotItem and multiple headers to create an effect like there are multiple PivotItems but a single one is displayed. All the pivot items will be the same type and will have a single template. One of the problems is...

Change image based on Theme selection for Light or Dark

c#,xaml,windows-phone-8.1,winrt-xaml
I'am creating a Windows Phone 8.1 app in which I use a number of images that should be shown according to the selected Theme Light or Dark. The Light and Dark image are created with the correct naming and scaling. I've created the following ThemeResource to set the Image Source...

How to pass Tapped event to sibling in the same canvas?

c#,windows-runtime,microsoft-metro,winrt-xaml,windows-8.1
I have two controls within a Canvas, one of them overlapping the other (in the z-order). Tapped events received by the control at the front will be routed back to the parent Canvas by default. However, I want the control at the front to ignore the event and have it...

Xaml Disable Control untill its code behind is executed

wpf,xaml,windows-runtime,winrt-xaml
I have made a customized button as shown below <Border x:Name="myBtn" Grid.Column="0" Width="320" Height="100" Margin="10" HorizontalAlignment="Right" Style="{StaticResource myBtnStyle}" Tapped="myBtn_Tapped"> <Grid> <TextBlock x:Uid="TBmyBtn" Margin="100,20,20,20" Text="Update" Style="{StaticResource myTBStyle}"/> </Grid> </Border> Its tapped event is as shown below private async void myBtn_Tapped(object sender, TappedRoutedEventArgs e) { //Many Network Calls //Updating Local DB //Updating...

Exception reading *.htm file from local app data (Metro App)

c#,windows-store-apps,microsoft-metro,winrt-xaml
I'm using FileIO.ReadTextAsync() to read an *.htm webpage which I have saved into "ms-appdata:///local", using Utf8 encoding. But I get a System.ArgumentOutOfRangeException when doing it. Additional information is No mapping for the Unicode character exists in the target multi-byte code page. Reading an ordinary *.txt file using the same function...

Behaviors and two way binding - how to tell what changed the DependencyProperty

windows-phone-8.1,winrt-xaml,mvvm-light
I have a custom behavior that allows me to bind a MapControl extent (bounding box) to the ViewModel; it works by calculating the extent of the map whenever the LoadingStatusChanged event of the map fires and setting the value of a DependencyProperty. This works fine -- when the map is...

Bind control property from the inner control

c#,wpf,xaml,templates,winrt-xaml
I have a control that contains another control. InnerControl contains some property like ButtonVisibility. The simplified InnerControl code sample is below public class InnerControl : ControlBase { //... public Visibility ButtonVisibility { get { return (Visibility)GetValue(ButtonVisibility); } set { SetValue(ButtonVisibility, value); } } public static readonly DependencyProperty ButtonVisibility = DependencyProperty.Register(...

Is there a better way to show enums in a control, eg combobox

c#,enums,winrt-xaml,win-universal-app
My goal is to present to the user the list of available enum's in a user friendly string format rather than the code value, and display said property when required. Given that the DataAnnotations namespace doesn't exist in 8.1 universal apps, I can't simply apply [Display(Name="Nice display string")]. I have...

Hide Flyout on button click (DelegateCommand)

c#,xaml,mvvm,winrt-xaml,windows-8.1
I am building a Windows Store app and I have a flyout that looks like this: The Flyout is functioning properly, and I am able to add a new address when I click on the "Add" Button. The problem is, I want to be able to hide the Flyout as...

Get parent DataContext from inside ListView item

c#,listview,binding,windows-phone-8.1,winrt-xaml
My scenario: In the current page I set a DataContext which consists in two properties, the first (page heading) Question, the second (a list of items) Replies. I'm binding Replies to the ItemsSource property of a ListView: <ListView x:Name="responseList" ItemsSource="{Binding replies}"> <ListView.ItemTemplate> <DataTemplate> <local:CustomControl /> </DataTemplate> </ListView.ItemTemplate> </ListView> Until this...

Change GridViewItem background color when loading

xaml,windows-runtime,winrt-xaml
I have a GridView with UserControl as item. When I'm scrolling, the UserControl are loading, the background in my UserControl is tranparent, but when its loading, the color of the background is a dark gray. Is it possible to change the "loading" color of the background?...

Relaunch WinRT app when suspended

windows-runtime,windows-store-apps,winrt-xaml,windows-8.1
I have a personal WinRT app I'm working on, and when the app is suspended, I would like to have it relaunch itself with different launch parameters. I know you can kind of already do this with toast notifications, but I would like to know if it's possible to do...

Force pivot item to preload before it's shown

c#,windows-runtime,windows-phone-8.1,winrt-xaml
I have a Pivot with several PivotItems, one of which contains a canvas that places its items in dynamic locations (depending on the data). I get the data, and I can place the items in their place before the user can choose this item (this isn't the first pivot). However,...

Semantic Zoom - Show letters containing no items

c#,xaml,visual-studio-2013,winrt-xaml,semantic-zoom
How can I show letters of the alphabet, which contain no items beginning with that letter (in gray) within the ZoomedOutView view of my semantic zoom control? I want to achieve something like this (excluding 'Social', 'Favorites' and '#'): but I end up with this: Now I know the code...

Examining the Windows Store apps AppxManifest at Runtime

windows-runtime,windows-phone-8.1,winrt-xaml
I try to load the AppxManifest at Runtime to read out the Version of the app. I fond this article: http://tonychampion.net/blog/index.php/2013/01/examining-the-windows-store-apps-appxmanifest-at-runtime/#comments I tried the line from the post: var doc = XDocument.Load("AppxManifest.xml", LoadOptions.None); But this will throw me the following exception: {System.Xml.XmlException: An internal error has occurred. at System.Xml.XmlXapResolver.GetEntity(Uri absoluteUri,...

How to know the Orientation of a Page before we had PageOrientation LandscapeRight/LandscapeLeft?

c#,xaml,windows-phone-8.1,winrt-xaml
In Windows Phone 8.0 we had PageOrientation with LandscapeLeft, LandscapeRight and more. Now, we only have ApplicationView.GetForCurrentView().Orientation and DisplayProperties.CurrentOrientation, but both of these only tell me if my page is Horizontal or Vertical. Does anyone know how to reproduce the LandscapeLeft and LandscapeRight we had in Windows Phone 8? When...

Windows Phone 8.1: How to change the background color and foreground color of ListPickerFlyout within a Button Flyout

windows-phone-8.1,winrt-xaml
I have a Windows Phone 8.1 Application. I have a button with a ListPickerFlyout. <Button x:Name="myButton" Foreground="Red" Background="Green"> <Button.Flyout> <ListPickerFlyout x:Name="myListPicker"> </ListPickerFlyout> </Button.Flyout> </Button> I need to change the background and foreground color of the ListPickerFlyout. I would be very glad if someone can help me. Thanks in Advance....

WinRT decimal to string formatting

c#,winrt-xaml
I have a decimal value I need to display in XAML. The problem with Win RT is that it does not support StringFormat in XAML. I am trying to use converter then: public class DecimalToCurrencyConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, string language) { if...

ScrollIntoView with animation

c#,windows-runtime,winrt-xaml
I have a groupped gridview and i need to scroll on group with animation. Now i use method GridView.ScrollIntoView(object item) which works good, but i need to add some animation. Plan: I want extract ScrollViewer from gridview using extension method GetFirstDescendantOfType<T> from WinRTXamlToolkit and then use method of ScrollViewer ChangeView(..)....

How to pass tap event through WebView

xaml,webview,winrt-xaml,windows-8.1
I have a scenario in which there is a GridView with zindex = 0 and there is WebView with zindex = 1 If I make WebView beackground color transparent, I can see my GridView Items. But they don't trigger click event. Is there a way to pass tap event to...

SQLite.Net, C# equivalent for SQLite bit datatype

c#,sqlite,windows-runtime,winrt-xaml,sqlite.net
I declare following class in c# [Table("Employee")] public class Employee { [PrimaryKey,AutoIncrement] public int EmployeeId { get; set; } public DateTime DateOfJoining { get; set; } public string Address{ get; set; } } and i invoke this method to create equivalent table in my SQLite database public async Task CreateTable()...

Variable is assigned but its value is never used

c#,winrt-xaml
Hi in Visual studio is use following code private bool answer = true; Private Buttonclick() { if() { answer =false } } Compiler gives me warning that "answer is assigned but its value is never used". How to clear this....

Resources Not showing in Designer View Visual Studio Windows Phone Application

windows-phone-8,visual-studio-2013,winrt-xaml,design-view
All the strings which I am taking from External Resource File is not showing up in designer View. But When I run my application it shows that string. My application is working but If it starts showing these texts in design view then I don't have to run application every...

How to improve performance method GetThumbnailAsync in window phone 8.1

c#,image-processing,optimization,winrt-xaml
I write a function to show images on a folder (assume i have about 60 images in this folder) in window phone 8.1. And the problem is function GetThumbnailAsync() take so long time when i create stream to get bitmapImage. Here's my code //getFileInPicture is function get all file in...

XAML Windows Store hierarchical View

winrt-xaml,hierarchy
I want to have a hierarchical display of my items. My items for instance looking like this pseudo-class: public class ListItem { public string Title {get; set;} public ObservableCollection<ListItem> Children {get; set;} } And I want to have them displayed like this: I don't want to collapse or expand items...