I have created a small chatting application in C#, and started as a Console Application. However I want to create a GUI for it using WPF. It's a class named DanMessengerClientwith functions such as InitializeConnection(), SendMessage(string msg), etc.
I have already designed the UI in Visual Studio, and it created it's Window1 class on ...
I just started learning the MVVM pattern for WPF. I hit a wall: what do you do when you need to show an OpenFileDialog?
Here's an example UI I'm trying to use it on:
When the browse button is clicked, an OpenFileDialog should be shown. When the user selects a file from the OpenFileDialog, the file path should be displayed in the text...
In one of my first attempts with WPF I went a bit too far:
I have an object that needs a different DataTemplate depending on one of its properties. In other words if (object.property=="multi") then the template should be a combo, etc.
Now I 've went ahead and obviously used a DataTemplateSelector to apply the required template. And in ...
I have this object:
class a
{
public string Application;
public DateTime From, To;
}
And I declare this list with it:
ObservableCollection<a> ApplicationsCollection =
new ObservableCollection<a>();
In my XAML I have:
<ListView Height="226.381" Name="lstStatus" Width="248.383" Horizo...
I have the following datatemplate:
<DataTemplate x:Key="ColoringLabels">
<TextBlock Padding="0"
Margin="0"
Name="Username"
Text="{Binding Username}"
Foreground="Gray"
FontStyle="Italic"
/>
<DataTemplate.Triggers>
<D...
I have a WPF form with 3 buttons and have routed events on them, commands are binded on start...
private void InitCommandBinding(UIElement frameworkElement) {
CommandBinding commandBinding;
commandBinding = new CommandBinding(ViewModelCommands.Save, Save_Executed, Save_CanExecute);
frameworkElement.CommandBindings.Add(com...
There is a strange bug in ListView/GridView in WPF when the SelectionMode is set to Single.
Ways to reproduce:
Generate a collection (the collection must have enough items so that the ListView can at least scroll 2-3 pages):
var customers = from c in _db.Customers
orderby c.Name, c.City
select c;
Bind the collection to the ...
ItemsSource="{Binding Source={StaticResource stringResources}, Path=MyProp}"
I tried and got so far but I don't get it compiled:
comboBox.ItemsSource = new Binding { Source = new StringResources(), ElementName = "MyProp" };
comboBox.DisplayMemberPath="Value";
comboBox.SelectedValuePath="Key";
It says that it cannot convert Binding t...
Hi
Im using pages in the WPF project that im currently working on. However i can't seem to figure out how to change the width of a page, or rather, the width of the window that hosts the pages?
Setting the page width property only changes the width of the page inside the window frame.
Setting the with of the mainwindow or navigationwi...
Hellow.
I'd like to know if there were a kind of automatic control sizing in WPF.
I mean, a way to auto size element regarding to the user's screen resolution, without having to define it in the code.
thanks.
...
Hey guys..
Windows 7 windows naturally have a semi-transparent header. What I just realized is that Google Chrome TabBar blends with this effect as if the TabBar background and the window header was the same thing! pretty much cool!
Is there a way to have the same result with WPF? Any example?
Thanks.
...
I'm opening valid XAML within my VS2008 solution in Expression Blend 3 and it is only showing XAML when I try to open individual XAML files. My solution/projects all build and run correctly.
When I go to View -> Active Document View the Design View, Split View and XAML View options are all grayed out... which doesn't make much sense.
I...
I have several applications in WPF that periodically crash on 2 different servers (a dell poweredge and a HP proliant). The problem is that the WPF applications both crash within d3d9.dll. Rebooting the servers always fixes the problem. The problem only occurs a few times a month. Both servers are running Windows XP instead of Windows 20...
Hi,
It is for the help section of the application. I am thinking to put flowdocumentReader to show the help document. But is it possible to show .rtf or any .doc to show in Flowdocument.Or is it neccesary to create a flow document in Xaml. Please help.
Thanks,
...
Hi,
There is a pagenumber property in flowdocument reader.But that property is readonly. Is there any way to goto particular page number in flowdocument reader.Please help.
Thanks.
...
Hi,
How do we have the topics listed from the flowdocument? and how do we go to particular topic in a flowdocument.
Please help.
Thanks,
...
Hi iam trying to progam an listboxitem Selected event in code because i need dynamical listboxitems.Iam coding this in wpf it works great.
<ListBoxItem Tag="cPage_Mod_Modules" Selected="ListBoxItem_Selected">
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResour...
For simple 'internal use only' apps, Winforms has a useful default exception handler, which allows an 'ignore', and tells you what the exception was.
WPF apps don't seem to get this nice exception handling - you always have to exit the application.
Obviously I can write my own default exception handler for WPF, but is there a simple ...
Hello,
I am developing a user control in wpf where I need to set eclipse background color as per value in database. Now that field contains values between 1 to 6.
now I want that according to values in of that field my eclipse should have different color.
I have defined 6 different brushes in resources. Their key values contain 1 to 6 n...
Hello,
I have an image in my xaml as so:
<Image Name="TotalFloors" Width="98" Source="../Images/FloorOne.png" Margin="0 0 0 10" VerticalAlignment="Bottom" />
This is loading fine, however everything i have tried to get this image change in code has resulted in nothing being displayed.
I tried a MessageBox.Show(TotalFloors.Source.ToS...