wpf-controls

How to change image\parameters on style definition ?

I define some new button style. The style default background is image X.bmp and when on 'mouseOver' is true the image is changing to Y.bmp I have 10 buttons on the code that need to use this style - and each of the button need to show different image as default different image on 'mouseOver' event. I can set the bitmap on each butto...

WPF Clickable button under label

Hello. I have button. I have expander in button and label above expander in the same button. I can click on button with no problem, but there is problem where I click on label (Nothing happens). How can I make this: When user clicks on label in button, button is being clicked. I want to transfer click event from label to button that cont...

How to mix Grid columns and ItemsControl features?

I'm looking for easies way to create Listbox/ListView/ItemsControl where each item will be Grid's row. I have simple tree structure (depth=3) Group -> Question1 ->Answer11 ->Answer12 -> Question2 ->Answer21 ->Answer22 ->Answer23 and i'd like to present it as Table. QUestion1 | Answer11 | Ans...

Tank level indicator question

Hello, I am playing around with C# and WPF. I am coming from the realm of microcontrollers and was wondering for the correct way to do things. My question is this, say for my horses I wanted to build an automated water dispenser as a school project for my kids using software. In the water control panel, the user would be able to see...

Wpf Grid rows height is not calculated correctly with SizeToContent

In the following example, there are two Grid rows with height of 6* and 4*. The problem is that only after the user changes the the size of the window, the correct height of the rows is calculated. This only happens when the SizeToContent flag is set. Any ideas why? How can I force the window to calculate the height automatically when i...

Represent a City in WPF

Say, I build a dynamic map in WPF. I need to represent in this map locations(say, cities). The representation of a city is simple: a dot (circle or image) and the text. Both text and dot image are customizable. What would you recommend using as a CityControl in WPF? Examples: A UserControl having an <Ellipse>(or picture) and <...

wpf - UserControl inheritance

Hi I have problem with control inheritance in WPF. I created a UserControl named BaseUserControl. I want for this control to be a base control for other WPF userControls. So I another UserControl called FirstComponent. In next step I changed this code FirstComponent : UserControl to this FirstComponent : BaseControl However during...

Getting a XamlParse Exception when using a userbaseclass with a UserControl

I have an abstract base class that subclasses the UserControl class with no XAML. When I create a class based on the base class everything works fine (compiles and executes). But when I add code to the base class to fire an event, it compiles but when run I get a 'The invocation of the constructor on type 'ExtendedDisplay.UserControls.An...

WPF TabControl rebinding everytime

Hi, I am data templating a tab control. Each time I select a tab, the binding of the contents get applied. So for eg, if I have a tree view expanded in tab1 and going to tab2 and coming back has this collapsed. The property binded to ItemsSource is invoked each time I flip the tabs. learned its all because the visual tree gets recreate...

Creating a Hyperlink to a different TabItem in WPF

I have a WPF application with multiple TabItems within a TabControl. In one of the TabItems, I want to have a Hyperlink that when clicked, changes the view from the current TabItem, to one of the other TabItems. I've looked into the NavigateURI property of Hyperlink but I haven't found a way to set that to be a separate tab in the same ...

Loading Custom Styles in a WPF Custom Controls Library

I have a Custom Controls Library (ex. MyCustomControls.dll) that is a plugin to a 3rd party application. It outputs as a class library and is invoked by the 3rd party application at runtime. My issue is the custom styles I have defined for various user controls like listviewitem, textblock now cannot be loaded at the application level. ...

WPF ComboBox doesn't change the selected item

Hi people, I'm a newbie in WPF, so it probably is something very basic that I'm forgetting to do but I can't see what it is. I have a window with a combobox that display some data, I want the user to select a category in this combobox. It's working partially. The window show the combobox, starting with no selection, then the user choos...

Cannot pass commands with CommandBinding into app???

Hi, I am trying to create an app where I am going to have 3 menus in multiple pages. Each menu will have uniques menu items. I need to instantiate these menus to multiple pages since all 3 menus will be the same in all pages. I created 3 Lists for 3 sets of RoutedUICommands for each menu in the App level which should be accessible by any...

How to display a different value for dropdown list values/selected item in a WPF ComboBox?

I have a WPF combobox bound to a list of items with long descriptions. The type bound to the ComboBox has both short and long description as properties. Currently, I am binding to the full description. comboBox.DisplayMemberPath = "FullDescription"; How to ensure that when the item is selected and displayed as a single item in the co...

Closing Button in an UserControl

Hello All, I am new in wpf,i have a problem,i have an usercontrol inside a parent window,and in my usercontrol i have a closing button,i just want to close this usercontrol on clicking this close button,in windows forms i can close it by calling "this.Close",but its not there in a usercontrol.please help me by telling how can i clo...

How to create dynamic tab using MVVM? Which part of the code is better place to keep the Tab generation code?

Hi, My advance thanks who going to hel me. I want to create a dynamic tab items in tab control using MVVM. As of now i placed my whole code which generates the tab items as a collection object in ViewModel which not sounds good, since its against MVVM.In MVVM the View and View Model needs get loosely coupled, but it fails in my case bec...

is there any opensource or free license Control project

is there any opensource or free license Control project that has fantasy looking and feel just like DevExpress? could you give some links.. if it isn't opensource, free licensed DLL is ok. thanks ...

How to get OnSelectionChanged ListBoxItem background change when modifying the data at the same time using a ListBox control ?

Hi, I have a ListBox control with an ObservableCollection instance as the control's ItemsSource property. Everything works fine, but when I handle the control's OnSelectionChanged, my business logic modifies the collection's data and I no longer get the ListBoxItem background change you usually get when your ListBox selection changes....

How to automatically scroll to the bottom of an HTML document loaded in a WebBrowser or Frame?

I'm using an HTML document to show text output in my application - this gives me the flexibility of HTML and the power of CSS, and I can publish the generated HTML as a log file openable in any browser. When new information is available, I update the HTML file and then call Refresh() on my WebBrowser control. Naturally, I want the user...

WPF ObservableCollection Edit Mode

Hello, I am using observables collection all around my applications. My problem is that when i use a popup window for editing those entities, my bound lists are getting changed when the user changes those corresponding fields in the window. How could i simply freeze the observable changes norifications, and release them only when the e...