To describe my problem i have created a small application.
At first the Usercontrol:
<UserControl x:Class="WpfApplication10.UserControl1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Name="This" DataContext="{Binding ElementName=This}"
>
...
I wish to use a Grid for my top level layout. The Grid will have 1 column and n rows. Each row in the Grid should also contain a Grid which shall have 3 columns and 1 row. In the second column is a GridSplitter and I am trying to use a SharedSizeGroup so that this changes the size of the first column across all of the nested Grids.
Here...
It seems like it would behoove me to learn this GDI replacement, WPF. I dropped some controls on a new WPF project and started looking around. It's obvious the playing field has changed again. If the past has taught me anything, I know I need to get this this thing under my belt (like it or not).
That being said, I'm not sure I can g...
Hi
This Textblock, defined below, shows when the window first loads because it has no Datacontext (and hence the converter code is not run) until an item has been selected from another control e.g. TreeView.
<TextBlock
Name="tbkDocumentNotFound"
Style="{StaticResource StandardText}"
Margin="4,4,2,0"
TextWrapping="Wrap" ...
Hi,
I'm currently trying to bind to certain items in a collection in wpf. This is best explained by an example.
My XAML is below:
<Canvas Name="TaskCanvas" Width="467.667" Height="414">
<Ellipse Name="myElipse" Fill="White" Stroke="Black" Width="126" Height="76" Canvas.Left="{Binding Path=XPos}" Canvas.Top="{Binding Path...
Ok I got the following DataTemplate:
Style="{StaticResource LBStyle}" HorizontalContentAlignment="Stretch">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
...
I downloaded some sample from internet.
but the sharp always disappear when i changed any value of Position, or Look Direction, or Up Direction.
I can't understand these properties, can anyone help me?
what's relationship between these properties?
is there any sample to show these relationship?
...
I've used a control template to change the appearance of a button in a trivial way. It now looks different, but does not behave like a button. There are really two problems:
The button's command is never executed
After clicking on the button, it appears selected (i.e., the ellipse turns into an ugly blue rectangle)
Here's the gener...
i want to override element triggers so when clicking on a textbox to change property of the parent border. however i get that the parent targetname is not recognized. please help.
code sample is this:
<Style x:Key="customstyle" TargetType="{x:Type local:customcontrol}">
<Setter Property="Background" Value="{StaticResource DownGradie...
There is an attribute "AffectsParentArrange" that implicitly invalidates the parent's layout - but I want to attach an event handler to the "event" triggered by that attribute.
When a child property with the attribute changes, the parent's arrangement is invalidated.
I have a custom control (which is not the immediate parent) that need...
Hi all.
I have a converter that returns a background colour based on a binding value on a DataGrid. This is working great in WPF but when i put this code into silverlight it is not happy.
Reading some posts on here it seems i can not use TargetType="{x:Type my:DataGridCell}"
The answer suggested was to use simply TargetType="my:DataGr...
I have an application that uses MVVM. I have several items on the main window that bind to the ViewModel for that window. When I run it everything works. However, when I add a user control to the main window and try to bind to one of its dependency objects it throws an exception (“Object reference not set to an instance of an object”). T...
I'm trying to wrap a TextBlock's Text property (which is a string that is pulled from the database) in quotes without using a converter; I'd never tried the Binding's StringFormat property before today, and I seem to be doing something wrong.
Here is the code that isn't working:
<TextBlock Text="{Binding QuoteText, StringFormat='\"{0}...
Hello, I'm just trying to find a way to control the expand / collapse of the treeview nodes through the object they're bound to. The object has an IsExpanded property, and I want to use that to show the treeview node itself expanded or collapsed based on that property.
Here's my code:
C#
public partial class Window2 : Window
{...
Hi All,
There is a lot of talk about the simplicity of Visual States and the transitions between them in WPF/Silverlight.
I have the need to generate animations dynamically at runtime, to animate the rotation of a 3D model (depending on the users mouse interaction, I want to rotate the 3D model around its axis).
I have been generating...
I have a WPF application in which the main window's decoration is custom, via WindowStyle="None". I draw my own titlebar and min/max/close buttons. Unfortunately, Windows doesn't enforce my MinWidth and MinHeight properties when the window is resized, thus allowing the window to be resized all the way down to 3x3 (appx - just enough to s...
For instance, I have this code:
<Grid>
<Rectangle Name="TheRectangle" Fill="AliceBlue" Height="100" Width="100">
</Rectangle>
</Grid>
VS.
<Grid>
<Rectangle x:Name="TheRectangle" Fill="AliceBlue" Height="100" Width="100">
</Rectangle>
</Grid>
Thank you very much for the information. I'm very e...
I am using MVVM pattern to implement a WPF App. My question is,
I have a Yes and No Radio Buttons and a text box.
ex:
Do you own a Car: Yes , No (Radio Buttons)
Enter Model:__________ (Text Box)
if user selects No, i am disabling it. if user selects Yes and leaves 'Enter Model' Textbox empty, i want to display a message or change backg...
I'm displaying data in a ListView. The data (gotten through a DLL and set in an ObservableCollection) is updated every 3 seconds using a TimerCallback. I'm using data-binding between my ListView and the data.
I'm adding right-click menu for the list view items. It seems like when the data gets updated, my listview's SelectedIndex wil...
Hi,
The WPF DragDrop.DoDragDrop
method has its firs paramter as DragSource.
Is it way you can obtain this DragSource object in the OnDrop or other drap Drp events?
Thanks
...