It is easy enough to create a command from my OnLoaded() event
handler code, but how do I call it from the View?
<window Loaded="onLoaded"> doesn't cut the cake anymore since
it calls code in the xaml.cs. How would I create an ICommand
equivalent?
...
Hi
I have a bounded listbox and I have created a DataTemplate that among other things have a button. I expected the listboxItem to get selected once I click the button but Its not working.
Any ideas?
...
I can't wrap my head around how to accomplish rendering this
public class Shape{}
public class Circle: Shape{}
public class Square: Shape
{
public List<Circle> CircleList{ get; private set; }
}
I have a List that holds Shape objects, now what I want to accomplish is having each object rendered in a grid.
If the object is a Squar...
In my WPF application (Composite Application) I want to store a variable in the App.config file, but as soon as I add an appSettings section in App.config, it gives me this error:
The type initializer for
System.Windows.Application threw an
exception.
App.Config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
...
This seems like a no-brainer but i just can't see how to do it.
The default background color of a selected row in DataGrid is so dark that I can't read it. Is there anyway of overriding it?
Tried this (modified from Neverminds link)
<dg:DataGrid.RowStyle>
<Style TargetType="{x:Type dg:DataGridRow}">
...
Could anyone explain how HierarchicalDataTemplate works
What Controls supports HierarchicalDataTemplate?
What does a control need to support HierarchicalDataTemplate?
UPDATE
What causes the TreeView to render
the parent and child nodes when the
same HierarchicalDataTemplate in a
HeaderedItemsControl only causes the
parent to be ren...
I have a class EmployeeViewModel with 2 properties "FirstName" and "LastName". The class also has a dictionary with the changes of the properties. (The class implements INotifyPropertyChanged and IDataErrorInfo, everything is fine.
In my view there is a textbox:
<TextBox x:Name="firstNameTextBox" Text="{Binding Path=FirstName}" />
Ho...
I have an application that is mixed Winforms and WPF. In Winforms, I have a global exception handler that is defined as follows:
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
Application.ThreadException += Application_ThreadException;
This ALWAYS catches exceptions anywhere in my application that occu...
Hi all,
Assuming I have an attached property defined like that :
public static string GetMyProperty(DependencyObject obj)
{
return (string)obj.GetValue(MyPropertyProperty);
}
public static void SetMyProperty(DependencyObject obj, string value)
{
obj.SetValue(MyPropertyProperty, value);
}
//...
I'm trying to disable the MouseOver effect on buttons, or at least change the colour of it, in WPF.
I'm using the following style:
<Style x:Key="Borderless" TargetType="{x:Type Button}">
<Setter Property="OverridesDefaultStyle" Value="True"/>
<Setter Property="Template">
<Setter.Value>
...
I've been investigating WPF mutipage reports and one option that looks interesting is WPF multipage reports - Part I.
There seems to be a gap in the blog post or my understanding of how to get from the report.xaml to a ReportDefinition object.
I think this should be really straight forward but I seem to be going around in circles.
...
I have a WPF application that occasionally crashes, and say "not responding". Is there a way to detect if the program is not responding? And if so, restart the WPF application?
This will be a temporary fix until the bugs are fixed.
...
I'm putting together a prototype to use XAML to create PNG buttons. The basic idea is that nice, gradient image buttons can be generated from localized strings instead of having them created by any sort of graphics dept.
The most straightforward example I found actually was to build a C# assembly and call it from PHP. I converted it to...
Is it possible to bind the multiple commands to the button.
I have a user control, which i am calling in my main application (parent application).
I want to handle a click command on both the controls (the user control as well as on the main window). However i am only able to get one.
Is there any way in which i can get this.
Any hel...
I have a datagrid in WPF that I am binding to an object.
I have a DataGridCheckBoxColumn on there which I want the users to be able to go through and tick the ones they want. Problem is they have to click twice, once for selection then again to check/uncheck. How on earth do you turn this off, I've been searching for way to long to fin...
I have a PowerShell function to look in a directory for zip files, extract it, and rename the files. The function also changes the status bar item to update what file it is on. I noticed that when this runs the GUI would freeze.
How can I get the function run and update the GUI without it freezing?
...
I'm designing a game like this
class Anima
{
Storyboard story;
Random rand;
Canvas canvas;
Ellipse target;
public Anima() {
rand = new Random();
canvas = new Canvas();
target = new Ellipse();
target.Fill = Brushes.Red;
target.Width = 50;
target.Height = 50;
Canvas.SetLeft(target, rand.NextDouble() * 300);
Canvas.S...
I am using a ImageButton as
<Button Width="80" Height="25"
VerticalAlignment="Top"
HorizontalAlignment="Right"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
Margin="0,0,1.5,0"
Name...
Hi.
I have a WPF ListView and I bind it to a IEnumerable<T> collection.
Everything works fine, but when I bind it to the IQueryable<T> collection, there are no items in list anymore.. Why? Is it not observable or what?
When I look at the definition:
public interface IQueryable<T> : IEnumerable<T>, IQueryable, IEnumerable
and
public...
I'm trying to figure out how come WPF doesn't go crazy when I set a window to resize to its content and then set its content to take all the available space... Any idea?
...