wpf

How to represent formatted text for display on IPhone/Android/WP7/PC

I am working on a multi-platform app (Mono) that will store text in a centralized location on the web and synchronize this text across clients that could potentially be IPhone/Android/WP7/OSX/Windows(WPF)/Linux/Web. I need to support some degree of rich text (at minimum bold/italic/etc./basic lists/alignment), and I am trying to find a ...

Secondary monitor bug: a problem in WPF or in the graphics driver?

I have discovered a strange bug with my WPF application and I am trying to determine whether it is a problem with WPF or my graphics driver so that I can report it to the appropriate company. I have a Quadro FX 1700 with the latest drivers (197.54) on a Windows XP system, running a .NET 3.5 SP1 application. I have dual monitors, my prim...

How to change the border on a listboxitem while using a predefined template

Hey, I'm using one of the defined wpf themes for my application, so all my controls automatically are pimped according to that theme. Now i am filling a listbox with items (usercontrols), but not all of them should be visible at all time. But when i'm setting height to 0 (of usercontrol) or setting to invisible, i get a thick grey bord...

How to change TreeViewItem property from an element in its Header?

I have a treeviewitem where the header property contains other elements such as TextBlock. I want if the TextBlock Text = "Empty", the TreeViewItem not to be focasable. Here I set the TextBox Focasable property but the containing TreeViewItem is focasable. I want the TreeViewItem containing the TextBlock with the Text="Empty" not to be ...

WPF> Using RadioButtonList style. I want to display user friendly enum strings. how?

Hi WPF lovers, I want to display all the possible enum values as Radio buttons. I am using popular RadioButtonList style to display the radiobutton from my enum using DataProvider in a Listcontrol. I can get all the radio buttons but the text appear with the radio button is not user friendly. I am using the following method. http://soci...

WPF or Windows Forms

I've been playing around with C# console applications for about a year and I want to move on to creating GUI applications. I have never done any GUI development besides basic Java applications, but I want to continue using C#. Should I start learning Windows Forms or jump straight to WPF? Is there a huge difference? Does WPF build on top...

WPF Binding to IDictionary<int,MyType>.Values Doesn't Respond to Property Changes?

I am binding a ListView a property that essentially wraps the Values collection (ICollection) on a generic dictionary. When the values in the dictionary change, I call OnNotifyPropertyChanged(property). I don't see the updates on the screen, with no binding errors. When I change the property getter to return the Linq extension dicti...

Whats so bad about binding your View to Property of a Model and NOT ViewModel ??

Hello, I often hear a Model must be wrapped by a ViewModel that the View is not coupled to the Model/not aware of it. With MVC it is common to bind the View to the Model... nobody complains so what ? I am frightened of creating all that wrappers and doing nearly only duplicating property stuff. ...

prevent wpf listview header double click autosizes column

I have a listview where I have templated the column headers and the listview items are templated also. However I have different tempalates for some of the rows in the grid view. When a user double clicks on the list view column header where you can drag the width of the column, the column header will auto resize, meaning it will increa...

WPF: Checkbox in a ListView/Gridview--How to Get ListItem in Checked/Unchecked Event?

In the code behind's CheckBox_Checked and CheckBox_Unchecked events, I'd like to be able to access the item in MyList that the checkbox is bound to. Is there an easy way to do this? <ListView ItemsSource="{Binding Path=MyList, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" MinHeight="100" MaxHeight="100"> <ListView.View> <Gri...

How can I dynamically set the event handler for a TabItem when it is selected?

In XAML you can do <TabItem Selector.Selected="myEvenHandler"></TabItem> to set the event handler for when that tab is selected. How can I do the exact same thing dynamically. I would prefer not to use the SelectionChanged event of TabControl if I can help it. Clearly there is a Selected event on the TabItem I just cannot seem to g...

MVVM Light Toolkit samples

Does anyone know opensource WPF applications created using MVVM Light Toolkit? Or any samples? ...

WPF Styles Button MouseOver Question.

Hi, I am trying to make a simple mouseover effect on a button, It does change the color when mouse is over but the color is immediately changed to the default button background... how can I override this behavior? this is my code: Style myBtnStyle = new Style(); Trigger bla = new Trigger() { Property = IsMouseOverProperty, Value = true...

C#: Drag & Drop with right mouse button

Hello, I'd like to do Drag & Drop with the right mouse button instead with the left one. However calling DragDrop.DoDragDrop() from MouseRightButtonDown instead of MouseLeftButtonDown doesn't do the job - DragDrop.DoDragDrop looks for mouse movements while holding down the left mouse button. Any idea how to realise Drag & Drop using...

How to reuse Silverlight projects in WPF?

I would like to use the same project (class library) in Silverlight and WPF. So, I started as a Silverlight Class Library. But the problem is: some of the common classes (i.e. Point, TouchAction) exists in different assemblies and compiler is showing the following error when I add the reference of Silverlight class library to WPF proje...

How to access MyProject.MySettings.Default.SomeSetting from xaml?

I have defined a StringCollection in the Project Settings. I want to use the values in a ComboBox. Is there a way to access it xamly? I tried: <CollectionViewSource Source="{x:Static src:MySettings.Default.MyCollection}" /> <CollectionViewSource Source="{Binding Source={x:Static src:MySettings.Default.MyCollection}}" /> *src is...

Bind a WPF combobox and get selecteditem to a richtextbox

Hi, I am using a dataset on the server, in this dataset I have a datatable that calls a stored procedure and returns column names from three tables. I call this stored procedure using a web service. I manage to show all the column names in my combobox but when I want to click a button and insert selected column name into a richtextbox ...

WPF Application Hang

Hi, I'm using Windows 7 Professional (x64) and having installed .NET 4.0 RTM on my machine. Since 2 days I'm noticing that every WPF application that I'm trying to run hangs and becomes non responsive (a not responding text is appended to it's title bar) and it's painted white. There is no info regarding any exception, no error messag...

WPF DataGrid: Resource per row?

Is there a way to xamly set a StaticResource per row in a DataGrid accessing it from all the columns? UPDATE My aim is to have 3 ComboBox columns, while only the last one is actually bound to the rows item. For instance, the DataGrid represents a list of Items. I have Category->Vendor->Style->Finish ComboBoxes, but those are only for ...

How should I associate a ListBox item with an item in a list of mine?

I have a listbox which has all the names for a list of "Gesture" objects I have. I want to make it so if I double click on a ListBox item I can then do something with its associated Gesture instance. What is the best way in C# to associate a ListBox item with an instance of a class of mine? I'm using WPF. ...