wpf

C# WPF MAF Add-In interaction between themselves

Hi, I would like create a very simple Paint application using MAF on WPF. The Add Ins I would like to create are: Main Image Processor - Shown the current paint and receive inputs from the user Tool Box - The user can select some types of drawings tools Layers - The user can select the layers to display, delete layers and select on ...

WPF MenuItem IsChecked Binding not working

Anyone know why the menu item binding does not work ? <ToggleButton Name="toggleButton" Checked="checkBoxPublish_Checked" > <ToggleButton.Resources> <converters:BooleanToHiddenVisibility x:Key="boolToVis"/> </ToggleButton.Resources> <Grid> <Image Height="auto" HorizontalAlignment="Left" Margin="5" Name="ima...

What is the safest way of databinding to an element in another xaml file in WPF

I have an application which shows a Tree where can select nodes of the tree and add them to a list. To keep the code clean I have moved the TreeView into it's own UserControl(I use this tree in several places) and xaml file. To add a node to the list I have an 'add' button. However I want to gray-out this 'add' button when none of the tr...

Fastest way to display a full calendar

Hello, I need to display a complete calendar (12 months, 31~ days/month) on screen. Currently, I'm using a 12-column grid, with each column filled with a "months" stackpanel. Each "month" stackpanel is filled with 31 (or less) day representations. Each day representation is composed of a DockPanel embedding three controls : a textbloc...

How can I change the binding for template elements at runtime?

I've found few solutions which assumes that I have 2 or 3 binding objects(or data templates) - that is not good solution for me. Is there an easy way to do this? I can think of cycling through the visual tree and set the binding that way but still this solution doesn't look very neat. Thank you in advance. ...

Wpf progressbar not updating during method calculation

Hey guys, In my app, i have an import option, to read info from a .csv or .txt file and write it to a database. To test, i"m just using 200-300 lines of data. At the beginning of the method, i calculate number of objects/lines to be read. Every time an object is written to the database, i want to update my progressbar. This is how i do ...

String Length in Pixels

How can I obtain the lenght of a string (given a font , size weight etc) in Pixels? I have seen recomendations to try System.Drawing.Graphics.* but that Assembly / Namespace doesn't seem to be available to me in silverlight. I hope to center a text box under an image, but the text is provided dynamically. ...

Non laggy movement in Flex or WPF

I'm trying to learn something about 2D games programming. For this purpose I've downloaded many samples developed in: Flex and Microsoft WPF. I've noticed that all the animations / moving objects are kind of non-smooth. I've seen a Flex example with double buffering which solved the image flickering, but it was laggy too. WPF example t...

Disable button in WPF?

I have a button and textbox in my wpf app. How can i make button not enable until user enters some text in textbox? ...

Calling a WPF Application and modify exposed properties?

I have a WPF Keyboard Application, it is developed in such a way that an application could call it and modify its properties to adapt the Keyboard to do what it needs to. Right now I have a file *.Keys.Set which tells the application (on open) to style itself according to that new style. I know this file could be passed as a command line...

WPF datagridtextcolumn - always show textbox

Hello, By default the WPF datagridtext appears as a label and enters an edit state upon clicking. Is there a way to modify the column so that the textbox is always visible (instead of depending on the click event)? Thanks in advance, JP ...

How can I know which version of WPF I am running?

I have discovered some differences between WPF 3.0 and WPF 3.5. As a result, I need to know if an assembly was compiled against 3.0 or 3.5. Is there a API for this? ...

How do WinForms controls inside WPF WindowsFormsHost remote?

Say, I have a WPF program with a Windows Forms control in "WindowsFormsHost" on some of its windows. I use that program via Remote Desktop. How will this control's graphics remote? Via GDI instructions as if it was WinForms app or as plain bitmaps like WPF does? ...

Append DataGrid inside of DataGrids RowDetailsTemplate

this appears to bind, but rows in Details Grid are empty. Something is off/missing? I've also tried {Binding SubCustomers} SubCustomers is a List on parent object. I am able to bind this way to single Fields such as FirstName etc.. just not the subcollection.. <DataGrid.RowDetailsTemplate> <DataTemplate> ...

WPF/MVVM: Delegating a domain Model collection to a ViewModel

A domain model collection (normally a List or IEnumerable) is delegated to a ViewModel. Thats means my CustomerViewModel has a order collection of type List or IEnumerable. No change in the list is recognized by the bound control. But with ObservableCollection it is. This is a problem in the MVVM design pattern. How do you cope with ...

how to drag-and-drop from ScatterView to LibraryBar

It is easy to drag-and-drop from LibraryBar to ScatterView. How can I drag-and-drop from ScatterView to LibraryBar? ...

Animate UserControl in WPF?

I have two xaml file one is MainWindow.xaml and other is userControl EditTaskView.xaml. In MainWindow.xaml it consists of listbox and when double clicked any item of listbox, it displays other window (edit window) from EditView userControl. I am trying to animate this userControl everytime whenever any item from the listbox is double cli...

Undo/Redo Support for Table Changes in WPF RichTextBox

As part of an editor project, I need to add functionality to the WPF RichTextBox control to allow the user to perform operations on a table. One of those operations is to apply a new width value to one or more columns of the table. I have a function that is applying a new Width value to the TableColumn objects in question, and the tabl...

Is there a way to edit a control's template based on the default template?

I'm trying to make just a few minor tweaks to the default template of a checkbox. Now I understand how to make a new template from scratch, but this I do not know. I did manage to (I think?) extract the default template via the method here. And it spat out: <ControlTemplate TargetType="CheckBox" xmlns="http:...

Any way to simulate MouseOver in WPF

I'm working on a link control in WPF which fits the text with icon links case in the Windows UX Guide. What I want is to have some text within a hyperlink that appears to the right of some image. In my case I started off by using a TextBlock that contained a Hyperlink which then contained my image and some text. <TextBlock> <...