xaml

Adding ComboBoxItem to a combobox inside a user control (XAML/WPF)

I am currently learning to create custom controls in WPF. I successfully created a simple custom control using a Label and a Text Box. I was able to allow setting the Label text by DependencyProperty. Now I am creating a user control that has a ComboBox. I need to allow adding items to this ComboBox from outside the control. To achiev...

Creating a semi-transparent blurred background WPF

Hi guys, I have a border, i want the background of this border to be partially transparent (opacity 0.8) but i do not want the image behind it to be well defined. The effect i am after is similar to the Windows Vista window border effect, where you can see that something is behind it but you cant tell what it is. A few clarifications:...

Calling a datatrigger for a radio button inside a datagrid

I have a datagrid with one column having a radio button. I want to set the GroupName when a certain condition is reached. Below is the code <Custom:DataGrid.Columns> <!-- ONLY ENABLED WHEN THE ITEM TYPE IS SINGLESELECT OR SINGLESELECT WITH ADDIOTIONAL DATA--> <Custom:DataGridTemplateColumn Ca...

How to display different Enum icons using XAML only?

I want to show a different icon/image depending on an enum value. For example, if I had the following enum: public enum UploadStatus { Unknown = 0, WaitingToUpload = 10, Uploading = 20, Uploaded = 30, UploadFailed = 40 } I'd like to write XAML that looks something like this: ... <EnumImage Value="...

Visual Studio 2010 randomly crashes when editing XAML

Visual Studio 2010 RTM randomly crashes when editing XAML in a WPF application. I'm running it on Win 7 fully updated. The installed extensions/addons are: Resharper PowerCommands The crash log is: Faulting application name: devenv.exe, version: 10.0.30319.1, time stamp: 0x4ba1fab3 Faulting module name: clr.dll, version: 4.0.30319.1...

Binding a combobox in XAML to a childwindow property

Hi, I want to display a child window that contains a combobox with several values coming from one of the child window's property: public partial class MyChildWindow : ChildWindow { private ObservableCollection<MyClass> _collectionToBind = // initialize and add items to collection to make sure it s not empty... public Observabl...

Is there a way to put Setter elements inside EventTrigger?

Working on a WPF application, I started working on a custom ControlTemplate. I reached the point where I need to change some control properties when an event occurs. For this purpose, there are Setter elements. Seems all good, but I cannot use them inside EventTrigger elements. For example, if a simple Trigger, that can be bound to cont...

Bind xaml vector images dynamically

I'm looking for a way to bind xaml images dynamically in code. There are lots of examples online to show how to bind png or xaml images in the window's xaml, or to load png files in code. But I have found no examples for xaml files with build action=page. XmlReader can't handle them since they are compiled to baml. LoadComponent(new ...

XmlDataProvider and XPath bindings don't allow default namespace of XML data?

I am struggling to work out how to use default namespaces with XmlDataProvider and XPath bindings. There's an ugly answer using local-name <Binding XPath="*[local-name()='Name']" /> but that is not acceptable to the client who wants this XAML to be highly maintainable. The fallback is to force them to use non-default namespaces in the ...

Get rid of XAML Window from Taskbar

If I have a XAML window that I show with ShowDialog, is there a way to make it (not) appear in the taskbar? The problem is that I can set the window to be topmost but if that window opens another dialog and I set that also to be topmost, I can put the second behind the first by clicking in the taskbar. This tends to confuse users. ...

ScrollView not MouseWheel Scrolling when not over Control

I am using Silverlight 4.0 What is happening is that the ScrollViewer will only scroll when one hovers over controls like textbox, treeviews, etc. If the mouse is over non control objects (like grids) then the mousewheel scrolling doesn't work. Is this normal behavior? ...

Expanding the xamwebgrid row to show additional details

I have the following idea: when the user clicks on the more... button of a grid row, the row must expand into a detailed state that shows additional details for the current entry. I know that xamwebgrid provides an expand command, but isn't it just for hierarchical data purposes? How can I display some movie screenshots let's say, only i...

wpf chart show horizontal scroll bar/viewer

Hello, I have a wpf column series chart and I have more than 15 columns. I want the horizontal scroll to show up. And i am not able to. Any help. ...

Creating a WPF Textbox Control like Outlook email recipient textbox

Hi, I'm looking to create a WPF textbox control that acts similar to the email recipient textboxes in Outlook (the To, Cc and Bcc inputs). I don't necessarily care that much about auto-completion (i've found millions of examples for that), but what I'm really struggling with is how to have delimited text entries in the textbox behave as...

Adding a button to a combobox in wpf

Pretty much I have an Editable Combobox and I want to add a button to the right of the drop down button which clears the selected item. So... |TextBox |X|v| I was thinking something like... <Style...> <Setter Property="Template"> <Setter.Value> <ControlTemplate> <ControlTemplate.Resources> ...

How to save the IsExpanded state in group headers of a listview

Hi, I have quite a tricky problem: I am using a ListView control with the ItemsSource set to a CollectionViewSource including a PropertyGroupDescription to group the ListView elements. The CollectionViewSource looks like this: <CollectionViewSource x:Key="ListViewObjects"> <CollectionViewSource.Source> <Binding Path="CurrentL...

Adding a textblock to a custom wpf control (piepiece control from codeplex)

Hi Stackoverflow! I'm currently building a Surface application where the main navigation is a circular menu. For each menu item I'm using a custom control that I found on codeproject.com: http://www.codeproject.com/KB/WPF/PieChartDataBinding.aspx (PiePiece control) The number of submenu items (which is also piepiece controls) comes fr...

Validation errors prevent the property setter being called

Hi, I am looking for a simple solution to the following problem: I am using a simple TextBox control with the Text property bound to a property in the code behind. Additionally I am using a validation rule to notify the user of malformed input. ... error display style h...

Why do I get a DependencyProperty.UnsetValue when converting a value in a MultiBinding?

I have an extremely simple IMultiValueConverter that simply OR's two values. In the example below, I want to invert the first value using an equally simple boolean inverter. <MultiBinding Converter="{StaticResource multiBoolToVis}"> <Binding Path="ConditionA" Converter="{StaticResource boolInverter}"/> <Binding Path="ConditionB"...

Assigning a float to a decimal property via a style setter in WPF

I have the following xaml in a template for a lookless control: <Style x:Key="NumericUpDownStyle" TargetType="controls:NumericUpDown"> <Style.Setters> <Setter Property="Change" Value="{x:Static local:Preferences.ChangeAmount}"/> </Style.Setters> </Style> Where the 'Change' property on the 'NumericUpDown' control is a d...