wpf

Dynamically change the attribute of property

i have one class contact in "Contact.DLL" which has 10 properties , properties has attributes (like IsDisplayed), now in different assembly"custom grid" , i am creating an form , where we query each attribute of class and display them in form. now i have to hide some attributes based on "isneeded" property of contact object, if isneede...

What is the meaning of x:Name in xaml (WPF) and its use with Storyboard.

<Border Name="ItemBorder" Margin="5 5 0 5" BorderBrush="Black" BorderThickness="1" Height="75" Width="75"> <Border.Background> <SolidColorBrush x:Name="ItemBorderBrush" Color="LightBlue"/> </Border.Background> <ContentPresenter/> </Border> <ControlTemplate.Triggers> <EventTrigger RoutedEvent="someEvent"> <BeginStoryboard>...

Fastest way to create a Converter in Visual Studio

When working with Binding converters are pretty common.. I always find myself Right-click the correct Folder Click Add Click New Item (Sometimes) Choose Code to the left Choose Class and "Add" (and sometimes when I'm in a hurry a create an AboutBox instead :-( ) Copy an old IValueConverter or IMultiValueConverter Change the...

WPF DataGrid Get Cell Value while user is typing

I have a WPF DataGrid and i want to show a completion list below the cell currently being edited. I cannot seem to find a way to get the uncommitted value. I tryed catching all key down events but cannot find where the value is stored until it is committed. ...

Is there a good tool for debugging XAML's databinding behavior / errors at runtime?

WPF is a great toolset, and XAML databinding is very powerful, but I've often run into difficulty arising from its transparency: It can be tough to debug a databinding failure when no errors are thrown. For example, I recently had to change a Style declaration like this: <DataGrid.RowStyle> <Style> <Style.Triggers> ...

Form.Show() is "Not Responding..."

Hello. I have a little trivial problem in my application. I have a dialog (d1) that inherits from Form. And in Main, if I call d1.ShowDialog ,it works fine. But calling d1.Show() opens a bad form with pale labels and textboxes, and when I try to drag that window form it says "Not Responding." What's going on? I think I need "Show"...

Deserialize causes InvalidOperationException when loading on startup

I have a class that is able to serialize and deserialize with ease after my WPF application has loaded. I am now trying to add in the ability to load a project on startup when passing in the project file. Unfortunately, it is throwing an InvalidOperationException stating: There is an error in XML document (2, 2). ---> System.InvalidOper...

What's wrong with TextBlock IsEnabled binding?

I've got a simple text block with a label and text box as content. I would like to bind the IsEnabled property of the text block to a property on my view model. For whatever reason the label and text box stay disabled even though the IsEnabled property is changing properly on the view model. Anyone know what's going on here? This does...

C#/WPF, how to make a window (created with Window.ShowDialog()) title bar blink when clicking its parent window (like MessageBox does)?

Hello everyone! I'm trying to create a custom MessageBox by using a WPF Window that is called with ShowDialog(). So far, I've managed to implement everything, except for one thing. As you know, when you use MessageBox.Show("text"); you cannot set the focus or click the parent window (the one that called the MessageBox). If you do try ...

Static Binding to Singleton Mysteriously Fails

I have the following singleton class which contains the following property: public class Manager : INotifyPropertyChanged { public bool IsOnline ... public static Manager Instance ... } In the mark-up I am trying to change the color of a button based on this online property: <Button.Style> <Style TargetType="{x:Type...

How do you conditionally bind data?

How do I conditionally bind data to a combo box? I have a combo box that by default should display an ID. However, if the user checks a check box then the display should display both the ID and a NAME. For example, "OO1: Sam". I have the default ID displaying correctly. I'm just not sure how to get both the ID and the NAME to display bas...

Help with creating dynamic XAML

Hi, I want to have WPF datagrid which is completely dynamic with columns as well as rows. My table1, ID HotelName Type Used Date 1 ABC 1 2 14/10 2 DEF 2 5 15/10 Table 2(reference to column Type in table1), ID Type Rate 1 1 STAR 1000 2 3 STAR 2500 I want to c...

Add byte to array removes capitalized letters

Hi, I try to add a byte to an array like this: messagedata.Add((byte)0xF0); But then when I check the array, the item looks like 0xf0 but it since it's going to be a MIDI message I found it has to be a capital F. What can I do to keep the letters capitalized? ...

Can I keep the tooltip open when the user is using a control in WPF?

I want to display the value of a slider as the user moves the slider up and down. Is that possible? ...

Create WPF Window at Runtime

Hi, Is it possible to create a WPF Window control at runtime? I'm thinking of a somewhat hack-ish solution to a problem, but I would essentially like to be able to have a dll which allows me to dynamically load a WPF Window and compile it's associated code behind (from an xaml and cs file respectivly). I assume I would also have to man...

WPF - How do I make a UI element animate along a path of an ellipse?

I have a canvas that contains a couple other elements. I need this canvas to animate continuously along a circular (elliptical) path. How can I do this in XAML? ...

WPF Transparent menu

Hello, I currently have the following menu: <Menu Grid.Row="1" Margin="3" Background="Transparent"> <MenuItem Name="mnuFile" Header="File" Background="#28FFAE04" Foreground="#FFFED528"> <MenuItem Name="mnuSettings" Header="Settings" Background="#28FFAE04" Foreground="#FFFED528" /> <MenuItem Name="...

Disable Right click and enable left click for contextmenu in WPF using MVVM

Code: <Button Style="{StaticResource HPForegroundStyle}" IsTabStop="False" Command="{Binding ForegroundPhoneCommand}" Click="Button_Click"> <Button.ContextMenu> <ContextMenu ItemsSource="{Binding OptionsMenuItemList}" Item...

How do I determine the selected row in a WPF datagrid using C#

How do I determine the selected row in a WPF datagrid using C# ...

How to display tooltip in XAML?

I'm writing an application using WPF MVVM. I have a view model with property IsFolderSelected like this: public class SelectFolderViewModel : ViewModelBase { public bool IsFolderSelected { get { return _isFolderSelected; } set { if (_isFolderSelected == val...