wpf

WPF ObservableCollection in xaml

Hi, I have created an ObservableCollection in the code behind of a user control. It is created when the window loads: private void UserControl_Loaded(object sender, RoutedEventArgs e) { Entities db = new Entities(); ObservableCollection<Image> _imageCollection = new ObservableCollection<Image>(); ...

Multiple usage of MenuItems declared once (WPF)

Is it possible in WPF to define some menu structure and than use it in multiple contexts? For example I'd like to use a set of menu items from resources in ContextMenu, Window's menu and ToolBar (ToolBar with icons only, without headers). So items order, commands, icons, separators must be defined just once. I look for something like th...

WPF Converter and NotifyOnTargetUpdated exclusive in a binding ?

Hi, I have a problem with a databinding in WPF. When I try to use a value converter and set the NotifyOnTargetUpdated=True property to True, I get an XamlParseException with the following message: 'System.Windows.Data.BindingExpression' value cannot be assigned to property 'Contenu' of object 'View.UserControls.ShadowedText'....

how to hide button in wpf

i want to hide button in wpf i used in widows form ex : button.visible=false what 's equivelant to that in wpf ?? thank in advance ...

Problem with UserControl with custom Dependency Property

Hi, I'm writing a user control with a dependency property for a search text called SearchText. It is a dependency property because I want to allow consumers of the control to use data binding. The user control contains a WPF TextBox where the user can enter the search text. I could use data binding to connect the SearchText dependency ...

How to set property only on second column of a ListView?

Introduction I have a ListView and want to format only the second column. The following XAML code does that: <ListView x:Name="listview"> <ListView.View> <GridView> <GridViewColumn Header="Property" DisplayMemberBinding="{Binding Path=Key}" Width="100"/> <!-- <GridViewColumn Header="Value" DisplayMem...

WPF and ADO.NET EF - not working

Hi, I'm writing a piece of code that takes the records from a sql ce 3.5 database, creates images based on the url provided and then fill the observablecollection with those Images. It looks like this: private void UserControl_Loaded(object sender, RoutedEventArgs e) { Entities db = new Entities(); ObservableCollection<Image> _...

SortDescription with custom attached property

Hi, In Xaml I can set a custom attached property using local:TestClass.TestProperty="1" An I can bind to a custom attached property using {Binding Path=(Namespace:[OwnerType].[PropertyName])} {Binding Path=(local:TestClass.TestProperty)} But how do I specify the namespace when I need to use a custom attached property in a SortDescript...

Render Silverlight Animation to video file

Hi guys I need to be able to render a silverlight storyboard animation to video. The animated content itself could be simple UIElements, Images or even two or more videos playing at the same time. Several ideas came to mind like RenderTargetBitmap on a single frame basis, but: 1) I've never tested this against video embedded content ...

radio button binding in WPF MVVM

can any one tell me how can we enable/ disable button by radio button in MVVM. ...

Wpf popups or modal windows as user entry screens?

I am building an application which has multiple user entry screens. I would like to know if there are advantages/disadvantages of using wpf popups rather than modal windows? I am using mvvm-light. I have noticed that popups are being used extensively in touch applications (eg iPad). ...

Sizing problems when using custom WPF dialog control

I am defining a custom control in WPF which serves as the base class for multiple dialog windows which all leverage shared services (positioning, Ok and Cancel buttons). The custom control is defined as follows: public class ESDialogControl : Window { static ESDialogControl() { DefaultStyleKeyProperty.OverrideMetadata(ty...

WPF Listbox is unbounded by the window

I'm working on a complex application, and I'm having an issue with a listbox not being bounded by the window height. Here's a simplified version of what it looks like. How would I get this listbox to correctly be bounded by the window? Right now, the bottom scroll button is off the screen and cannot be seen until the window is big enough...

WPF Databound Listbox

I have a listbox bound to a list of objects for a data entry screen. The item template includes textblocks, a checkbox and comboboxes. When the listbox is populated I would like to change the foreground color of the textblocks to red if object.value1 = true and object.value2 = 0. Any ideas? ...

Templates and inheritance

Hello, I have a big problem. I use additional controls for Wpf. One of them is Telerik RadWindow This control is already templated. Now I want to create custom Window with will inherit from RadWindow, and make custom template, eg. One base window will contains grid and two buttons, second base window will contain two grids (master - det...

Generating Large Sets of Similar Windows in WPF

I'm hoping for some insight from someone better experienced than I for creating a window/set of windows for displaying data in WPF. Here is a little overview of my task: I will getting a large amount of binary output from a receiver. This will then be parsed and keyed to the meaning of the particular bit (i.e. word1 bit1 = Receiver St...

How to change the direction of wpf marquee dynamically?

Hi all, I want to change the direction of my marquee on changeDirection button click. My code for changing direction is : private void changeDirection_click(object sender, RoutedEventArgs e) { if (_marqueeType == MarqueeType.RightToLeft) { _marqueeType = MarqueeType.LeftToRight; StartMarqu...

DependencyProperty ValidateValueCallback question

Hello, I added a ValidateValueCallback to a DependencyProperty called A. Now in the validate callback, A shall be compared to the value of a DependencyProperty called B. But how to access the value of B in the static ValidateValueCallback method validateValue(object value)? Thanks for any hint! Sample code: class ValidateTest : Depend...

wpf converter : setting multiple properties

I am used to using converters that return a value per property, such as Foreground color. Is it possible to have a converter that works with multiple properties? such as: Foreground, Background, Font-Weight, Font-Size How can I create one converter (or less than 4) that could set multiple properties? ...

How to find in code the parent Window or WinForm of a WPF control?

I have a situation where I need to find the parent Window or WinForm which is hosting the WPF control. I need to get the handle of either the parent Window or WinForm whatever the case may be. The problem is when the WPF control is hosted in a WinForm using ElementHost. How can I find the Handle of the hosting WinForm from a WPF control...