External WPF binding styles without XAML tag

If I have a WPF DataGrid that looks like this: <DataGrid x:Name="DataGridQ" AutoGenerateColumns="False" Grid.ColumnSpan="2"> <DataGrid.Resources> <Style TargetType="{x:Type DataGridRow}"> <Sette

Change the format xxxxxxxxxx to xxx-xxx-xxxx

I have a textbox in WPF and I need to display text in xxx-xxx-xxxx format. <TextBox FontSize="30" Text="{Binding MyString,UpdateSourceTrigger=PropertyChanged}" Grid.Row="3" MaxLength="10"></TextBox> MySt

Windows Phone 8.1 NullReferenceException

I'm Currently Working on a windows 8.1 Application and im trying to set the value of a textblock that is inside of a Pivot Page. When I try to set the value of the text Block I get a weird error about a Null Refrence Exception. The Code for the XAML

Link width to a columnWidth of a grid not visible in XAML

im trying to bind the width of a button and a TextBox to the width of a column they are in. Additionally i want to change the visibility of the whole grid. I set visibility to "Collapsed" and in the code behind file i change the visibility to vi

The link does not work on GroupBox.HeaderTemplate

I created a custom header for my GroupBox like the following image: I want also to set a Binding on the Backgroud of this header, so I wrote the following code: <GroupBox Width="130" Height="80" BorderBrush="Black" Margin=

How to focus on the item in the list?

I have a defined list box like this: var listBox = new ListBox(); listBox.Items.Add(1); listBox.Items.Add(2); listBox.Items.Add(3); And I want to set focus directly to an item in the listbox. If I do this: listBox.SelectedIndex = 0; listBox.Focus();

Formatting data in MVVM in the Windows Phone application

I have a DataModel and a ViewModel working successfully together with my xaml view. In the view I use databindings. In my DataModel I have some properties like Distance declared as int. When displaying the values in view, I want a formatting like add

How to use a user XAML control in a class library

I have a sub project wich is a class and contains DataLib.cs and an user controll MediumTile.xaml. This user control will be the generated to an image to use it as tile background. But before I have to change a few thing dynamicly. So how can I get c

WPF Animation Relative values

I am trying to learn about Storyboards and animation in WPF. I have a very simple question which I cannot seem to answer. I have a rectangle that is placed in a grid. I am trying to move the rectangle from one side of the grid to the other side. I ca

Filter elements in VB.net datagrid in WPF

WPF/VB.net newbie here. I'm trying to filter rows in a datagrid and having a fun time. I've managed to create a list of objects and use the itemsource property to get the datagrid to populate. Now I have a checkbox that for arguments-sake I want to c

WPF data binding does not work

I've read the online document about data binding but still couldn't make it work. I simply want to understand data binding and do things the way it should. Here is my code in my UI.xaml.cs namespace mynamespace { class Customer { private string _name

Build an error summary in WPF

My form is bound to an object that implements IDataErrorInfo and it validates correctly on a field by field basis. I would like to have some way to summarize the results based on the fields on the form, and not the Error property of IDataErrorInfo. I

TextBlock TextWrapping no packaging # 2

OK... so this solution doesn't help XAML is here <ListBox ItemsSource="{Binding Path=ContentItems}" Background="White" > <ListBox.ItemTemplate> <DataTemplate> <Grid Margin="2" Height="Auto" Widt

Determining the CustomPopupPlacement used for WPF Popup

Am trying to figure out which of the passed in array of CustomPopupPlacement positions have been used when the popup actually renders. Is there any event to detect this? This msdn thread from 2009 seems to be exactly my issue however there does not s

XAML Globalization Using Resources in a Combo Box

I am globalizing my WinRT app and I can't use language resources in my comboboxs. I can use it in my TextBlocks using Text property but not using x:string. What am I doing wrong? TextBlock x:Uid="Priority" Text="Default"></TextBl

XAML Image tag (Win8) not working with some paths

The Source attribute of the Image tag works only with the files which were added to the 'Assets' folder in the Solution Explorer. I've got two files in the Assets directory: Logo.png and Logo2.png, but only Logo.png is added to 'Assets' in the Soluti

Link to the chain of self-control

I have a custom converter that I want to make use of in xaml. The converter just places Admin if value is equal to 0, Cashier if it is equal to 2 etc.. Anyways this is what I am looking for. <ComboBoxItem Content="{Binding 'I want to place the val

WP7 DatePicker, TimePicker Data Link

I'm building an application that needs to display and accept dates from my model ( which is retrieved from a database). The model exposes a property called EntryTime: private DateTime entryTime; [Column] public DateTime EntryTime { get { return entry

Using DataTrigger in WPF

I have a TextBox control defined in XAML and I want to apply different background colors to the TextBox based on its IsReadOnly or IsEnabled properties. I used dataTriggers to actually switch between the colors as shown below: <Style x:Key="TextBo

Set the background / color image in WP7

I can't seem work out (even though I have seen other apps) how to set the whole background of a WP7 page to a image or colour, like in Panorama for example. If i set Grid x:Name="LayoutRoot" Background="#FF0079C1" Or <Grid.Backgroun

External alias in XAML

I'm currently using a library that implements Menus and ContextMenus for Silverlight 3 and 4. This library defines a MenuItem class in the System.Windows.Controls namespace. No problems with SL3 because there is no MenuItem class elsewhere in the Sil

ColumnDefinition MinWidth does not work correctly

I'm using a Grid in WPF (xaml) and I'm have some strange effect when using the MinWidth property in a ColumnDefinition. For example, when I use 9 ColumnDefinition and every ColumnDefinition has the 'Width="*"' property and one of the middle colu

Child controls are inaccessible due to access modifier

When I create a user control in WPF it would appear that all the children of this control are declared as internal? I've not been able to verify this, nor finding any resources discussing this matter at all. I can access the controls in the same asse