wpf

MVVM flow chart question

Hi Folks I'm new to WPF and after glancing thru this article, http://stackoverflow.com/questions/3432423/mvvm-pattern-for-a-diagraming-application-with-wpf-convert-enum-to-xxxviewmodel I like to know if MVVM could be used or encouraged to use for a simple app that I like to try: The simple app is a wpf flowchart designer that allows ...

What would be a good way to return a result from a non-modal notification?

I am working on adding a non-modal notification system to my application. The notifications will be unobtrusive pop-ups that appear in the corner of the app. There can be more than one notification at a time. Most of the time these notifications will not require user input, but sometimes they will be used to get user input for things th...

WPF mnemonic selection doesn't behave like WinForms mnemonic selection

I'm maintaining a hybrid application, containing both WinForms and WPF technologies. Ideally, the look-and-feel should be identical between the WPF controls and the WinForms controls. Here's the difference: in WinForms, if you select a text box with a mnemonic key, the entire contents of the text box is automatically selected. This is g...

RenderTargetBitmap problem

I am trying to add the image of a usercontrol to viewbox. I am creating the usercontrol dynamically. I am using the code below. private static RenderTargetBitmap CaptureScreen(Visual target, double dpiX, double dpiY) { if (target == null) { return null; } Rect bounds = VisualTreeHelper.GetDescendantBounds(target)...

Starting WPF MVVM. Use a framework?

i took a look at some questions here at stack overflow like this & mix10 building your own mvvm framework i wonder if as a beginner its better to start from scratch (but i heard from the vid, its not recommended) or use a framework also which is more suited as a beginner framework to learn? i find that after reading quite a few article...

WPF ComboBox DataBound Event?

I use ComboBox.ItemsSource=[some data collection] to bind data to the control. I want to hookup an event handler to the combobox so that whenever its data updated (or first time bound), I can do somthing. The problem is I can't find an appropriate event for it. The close guess is DataContextChanged. But that is not invoked when the ite...

WPF - Expand Window to the Left

I have a WPF window with expandable panel (via Expander). The panel is on the left side of the window, and when expanded the window grows to fit the content. By default, windows are anchored to the top-left, so my window grows to the right. I'd like the window to grow to the left. I tried to do the following in the Window.SizeChanged ...

Add lines to gridview

Hi, I'm trying add vertical lines to my grid. I have found some examples but nothing works. <ListView ItemsSource="{Binding Path=CheckableObjectFacilities}" x:Name="ListViewObjectFacilities" Margin="5"> <ListView.View> <GridView> <GridViewColumn> <GridViewColumn.CellTemplate> ...

WPF: Problems with Command when put a ListView inside an Accordion using MVVM Light

Hi guys: I have this View: <Grid Margin="10,0,10,10"> <StackPanel> <wpftoolkit:Accordion Margin="4" HorizontalAlignment="Stretch" Name="accordionCB" ItemsSource="{Binding Path=ContentBlockCategories}" SelectionMode="ZeroOrMore"> <wpftoolkit:Accordion.ItemTemplate> <DataTemplate> ...

WPF: Binding lists in XAML- how can an item know its position in the list?

Given the following XAML code that with a ListControl like behavior: <StackPanel> <ItemsControl Name="_listbox" ItemsSource="{Binding ElementName=_userControl, Path=DataContext}"> <ItemsControl.ItemTemplate> <DataTemplate> <DockPanel> ... ...

How to show a grid for few seconds in WPF?

I have a grid of which Visibility I control from code. I want the grid to be Hidden after it becomes Visible, say after 5 sec.Are there any easy way of doing this in WPF? ...

How to set Panel.Zindex value though XAML code if any of the Grid/UserControl children having the focus.

Hi, I think I have not explained correctly. So i have just edited the previous post. Please go through my exact requirement I have user control with a button. I have written code to enlarge the button if it gets focus through rendering in style. In my window, in the main grid i have placed 10 instances of this user control ( 1 contro...

WPF: InkCanvas + Frame

I need to draw over the html page. Page displayed in a Frame element. The problem is that InkCanvas does not work with Frame. I tried to insert TextBlock instead of Frame - painting works. Does not work: <Frame Grid.Row="1" Source="http://google.com/"&gt;&lt;/Frame&gt; <InkCanvas Grid.Row="1" x:Name="inkCanvas" Background="Transparent"...

MVVM Light and Undo / Redo?

I am probably mixing up some responsibilities (and maybe even terminology) here, but I can't quite wrap my head around this. Is there any relationship between the Command Pattern and the Commands found in MVVM Light (and therefore aswell in WPF)? I would really love to implement some kind of undo / redo mechanism but can't quite figure ...

WPF Combobox current scroll position does not change

Hi, I have a public property of type ObservableCollection<ClassName> in the code behind file and i have bound this to the ItemsSource property of the Combobox. <ComboBox Height="23" Margin="82,34,71,0" Name="comboBox1" VerticalAlignment="Top" ItemsSource="{Bindi...

How to set the border for a WPF DataGrid Row which is currently having the focus

Hi, I want to set the border for a DataGrid Row which is currently having the focus. But not the seleced row because when the Multi selection is enabled for the datagrid then there is a chance that multiple rows can be selected. I need a solution in XAML Thanks in advance! ...

WPF - Adding a Rowheader to a ListView Grid View

I need to add a rowheader to a Listview GridView. it needs to act like a datagrid rowheader, sop it should be freezable. is thsi possible? can anyone show me some source code to do this? Thanks ...

Virtual keyboard Popup not working on a derived textbox in wpf

Hi. I have a derived class called NumericTextBox that is derived from TextBox.This has all the validationsf for the data to be numeric. Now, i have a popup attached to this textbox in my window. the popup is a virtual keyboard. this lets the user input from both Keyboard and Mouse. but whenever i click a button on the popup, the PreivewT...

How should my model look like?

As I am further digging into MVVM and MVVM-light I recognized, that there is no MVVM-light provided base class for models. But from my understanding, messaging and raising notifications could also happen in a model. At least in communication between models I would find that messaging would come in very handy. So I just decided to deriv...

Keeping Canvas overflow in WPF

Hi guys, I have a (hopefully) interesting question. First of all what I'm trying to do here: I'm trying to create a pie-chart-like set of buttons, later this control will be used within a touch enabled application. The control draws and looks just fine, also all of the behaviours are fine so far. However, one thing that I'm having issu...