I have a Stackpanel and want that the items automatically set their sizes regarding to their contents but the items should not automatically fill the height of the Stackpanel (But Stackpanel should have auto height according to largest item). I also tried WrapPanel which has the same problem.
I want the TextBox "test" be be vertically c...
I have some HTML content that I need to print. For other printing tasks, I've had great success using the PrintDialog class by grabbing a grid out of my resources, setting the grid's DataContext property to a ViewModel, and then passing the grid to the PrintVisual method.
I tried using the above method to print HTML by instantiating a S...
Using Expression Blend, I am trying to create an interface where the tabs are on the left, and the display area is on the right. It would give more of the illusion of buttons on the left.
I tried adding the SimpleTabControl with a Fill layout, and setting the TabStripPlacement to Left. However this gives me a control which has 2 tabs st...
Hi
In the following code i want to get the pixelwidth but when i apply DecodePixelWidth because of memory performance i loose the original pixelwidth value. Thanks in advanced.
BitmapImage myBitmapImage = new BitmapImage();
myBitmapImage.BeginInit();
myBitmapImage.UriSource = new Uri(uri, UriKind.Absolute);
myBitmapImage.DecodePixelWid...
Hello!
First take a look at my code:
<ListBox ItemsSource="{Binding}" SelectionMode="Multiple"
ItemTemplate="{StaticResource ContactTemplate}">
<ListBox.ContextMenu>
<ContextMenu>
<MenuItem Name="mnuEdit" Header="_Edit" Click="MenuItem_Click" />
</ContextMenu>
</ListBox.ContextMenu>
</ListBox>
...
This may be a bit winded because I am new to wpf. I have created a partial class for an entity in my L2S class that is primarily used for validation. It implements the onchanging and onvalidate methods. I am trying to use the MVVM pattern, and in a window/view I have set the datacontext in the xaml:
<Window.DataContext>
<vm:StartVie...
I have a defined path in XAML:
<UserControl.Resources>
<ResourceDictionary>
<Path x:Key="N44" Width="20" Height="80" Stretch="Fill" Fill="#FF000000" Data="M 20,25.2941L 20,29.4118L 15.9091,29.4118L 15.9091,40L 12.2727,40L 12.2727,29.4118L 2.54313e-006,29.4118L 2.54313e-006,25.6985L 13.4872,7.62939e-006L 15.9091,7.62939e-006L...
How can I make a Datatemplate for a ViewModel blendable (designable in expression blend). When I go to resources and try to edit the DataTemplate directly all I see on the Drawingborad is a blank rectangle. This is because the DataTemplate is not bound to anything. Of course I can create a UserControl and create some designtime data in c...
I have the following problem in wpf:
I have defined a user control (in namespace test) containing a textbox (and several other controls, only show the relevant parts of the xaml):
<UserControl (...)
DataContext="{Binding RelativeSource={RelativeSource Self}}"
name="Spinbox">
(...)
<StackPanel Orientation="Horizontal">
...
In my project I am sending the window to tray on close. How can I give an animated effect for this ie, the movement from the current window position to tray. And also the reverse, means on double clicking on the notifyicon in tray, the window is coming to front?
...
How does the Dispatcher thread work in wpf a UI control?
...
Can we host a VB6.0 user control in WPF forms?
...
Hey,
While experimenting with pixel shaders in WPF I decided to draw some pixels onto a fullscreen image through writeable bitmaps based on the MSDN sample
http://msdn.microsoft.com/en-us/library/system.windows.media.imaging.writeablebitmap.aspx
I used a blur shader on the image.
To have a continuous effect I took the image back from t...
WPF Toolkit, How to apply date format in C# for datepicker control?
...
I have a window that I sometimes open using Show() and sometimes using ShowDialog(). In the second case, the returned dialog result is important for me. But if I set the DialogResult after calling Show() I get an InvalidOperationException. Is there a way to find out which method was used to open the window and set or not the DialogResult...
Hi,
I am trying to create a situation where one or none of a grouping of two ToggleButtons can be on at any time. The problem that I have is if I change the state of the backing variable the UI state does not update.
I do have INotifyPropertyChanged implimented.
I've created my ToggleButtons like this:
<ToggleButton IsChecked...
I want to have an empty item in the comboBox to allow the user to "Unselect" and keep the comboBox empty (Null value).
How can I do that?
...
<Grid>
<ListView ItemsSource="....">
<ListView.View>
<GridView>
<GridViewColumn ......../>
</GridView>
</ListView.View>
</ListView>
</Grid>
When there are thousands of rows the above XAML causes the grid to size larger than the form and data becomes hidden.
What I want to do is to keep the ListView so t...
I am using WPF/C# with the browser-style navigation model.
At one point if the user presses a button, I will initiate a long-running task. At that point I'd like to display a progress bar and, when then long-running task completes, transition to another page, without user interaction.
Setting up the progress bar and keeping it updated...
I'm trying to hit test items within a listbox but to no avail. Is it possible? The VisualTreeHelper shows the x,y coordinates returning 0,0 for each and every item within which would seem to rule hit testing out. Does anyone know of a solution or workaround?
...