wpf

Setting a button's text to have some bold characters in WPF

I'd like to know if it is possible to define as the text of a Button in WPF, something like: a b c I've tried setting but that doesn't seem to work. Is it only possible to use the Bold tag with FlowDocuments? Thanks ...

What does the x: thing in WPF serve for?

I've seen it a lot and I don't know what it means. I'd say it has something to do with namespaces? I've already googled it but it wasn't clear to me what it's purpose is. Could anyone explain what it is and in which situations it is usually used? Thanks edit: <Window x:Class="WpfApplication8.MainWindow" xmlns="http://schemas....

WPF version of VirtualScreen

Is there a WPF version of System.Windows.Forms.SystemInformation.VirtualScreen? ...

WPF: Binding to a custom class "Cannot find source for binding".

Did this: public class myClass : INotifyPropertyChanged { public bool? myFlag = false; public bool? MyFlag { get { return myFlag; } set { myFlag = value; OnPropertyChanged("MyFlag"); } } public event PropertyChangedEventHandler PropertyChanged; public void ...

WPF: How to select parent listbox if user clicked on child listbox

In my application using DataTemplate mechanism I insert into ListBox item another listbox. But is it possible that when selected one listboxitem in parent listbox, the focus may be on another parent listboxitem's child (see picture) How to do: if one of child listbox in focus (one item from them selected), then parent listboxitem bein...

Binding to a list of points that have to be drawn in a winformControl

Hi, I have some hardware with some controls to it. There are some visual controls I want to use in My WPF application. I have a binding Source object and a WPF with A TextBox To make it work I use the TextBox.TextChaned to execute some code that is among othere things painting my lines (from the list of points). XAML <TextBox Text="{...

wpf: design time error while writing Nested type in xaml

I have created a usercontrol which accept type of enum and assign the values of that enum to a ComboBox control in that usercontrol. Very Simple. I am using this user control in DataTemplates. Problem comes when there comes nested type. I assign that using this notation EnumType="{x:Type myNamespace:ParentType + NestedType}" It wor...

wpf mvvm .. access view elements in viewmodel

I am in phase of learning wpf/mvvm as per i get to know in vm we declare commands and bind them to view element's event rather doing this in codebehind file... what i am not getting is, how would we access view elements and eventarguments. ...

WPF Custom lasso selector ?

Hello, How can I implement a custom lasso selector on InkCanvas ? How to detect involved inks or elements by collecting points generated by mouse move ? Just point me to namespaces & classes that .Net 3.5 provide to help solve the problem ...

How to call application menu programmatically ?

I have non-rectangular transparent window with custom style. <Window x:Class="TestWindow" x:Name="Window" Width="350" Height="450" AllowsTransparency="True" WindowStyle="None" WindowStartupLocation="CenterScreen" FontSize="14 px" FontFamily="Fonts/#Tahoma" Background="Transparent"> I have a grid for title and system buttons...

How to create a dropdown user control

I want to create a dropdown user control that works like a combobox. When the user clicks somewhere in the application (not in user control), it should close automatically. For simplicity consider a textbox that shows a panel underneath it when clicked on. The user can select something in that panel, but when they click on something els...

Specify width/height as resource in WPF

Is there a way in WPF to specify a width/height as a resource, so that it can be reused in several styles for e.g. margin/padding? ...

Hook in datatemplate view switch/change

Hello, I am switching my UserControls via DataTemplate. When I leave the UserControl/DataTemplate View I need to ask wether the user wants to save or not because else all data will be lost like graphical location points x,y of a user drag/dropped Rectangle on a canvas. How can I hook into the datatemplate change and bring up my own sav...

Why is the TreeViewItem's MouseDoubleClick event being raised multiple times per double click ?

XAML <TreeView Name="GroupView" ItemsSource="{Binding Documents}"> <TreeView.ItemContainerStyle> <Style TargetType="{x:Type TreeViewItem}"> <EventSetter Event="MouseDoubleClick" Handler="OnTreeNodeDoubleClick"/> </Style> </TreeView.ItemContainerStyle> ...

TreeView using Hierarchical Data Templates binding to different collections

I'm using a TreeView with a Hierarchical Data Template to bind to a View Model hierarchy, my problem is i have multiple child collections of different types (same base class though). Seems relatively simple to use the template to bind one of the collections but i'm struggling to work out how to do both. class ParentViewModel { List<...

wpf edit item in listbox when a button is clicked somwhere on the form

Using this question (Inline editing TextBlock in a ListBox with DataTemplate (WPF) I now have a listbox that can be doubleclicked to edit the items in it. What I want now is to have a button on the form, which when clicked will add a new item to the ListBox (this is easy), but then change the ListBoxItem into editmode, so the user can en...

WPF: Is there a simple way to create a Progress Window?

I tried creating one, but the BackgroundWorker in Window1 couldn't access the ProgressBar in Window2 once the reportProgress was activated, because "The calling thread cannot access this object because a different thread owns it". Seems there's a lower level thread model I could use, but it also seems a lot more complicated. ...

WPF Grid/WrapPanel AutoSize Animation

Hi, I have the following layout in WPF <grid> <row height=auto> <border> <listbox> <border? </row> <row height=*> <othercontent> </row> </grid> Using MVVM and have listbox itemsource bound. I am using a wrapPanel in the grid, and have scrolling disabled so the Grid row height will grow and shrink based on the list box contents. Thi...

How can I scroll on scaled control ?

hi guys, I need a zooming mechanism. So I found one on http://stackoverflow.com/questions/850554/zoom-control-to-wpf-form which seem to be suitable for me. I have made a slider and apply ScaleTransform. My questions is: Is there any way I can wrap this into a scroll viewer so that I could scroll to the enlarged part that is not visi...

WPF How can I apply global configuration file for solution with couple projetcs

Hi, I want put all configuration data from WPF projects to one file for whole solution. E.g. service references, etc. How can I read this data in every single project instead default app.config file? Thanks for any help. Kamilos ...