wpf

WPF: mysterious exception "Could not find file 'D:\xxxx\bin\Debug\xxx.vshost.exe.config'."

I am new to WPF and .net. I have a WPF app which someone else had written earlier and AFAI remember it was working just fine some time back. But today i see this mysterious error when trying to build the app and run from debugger : Exception : "Could not find file 'D:\xxxx\bin\Debug\xxx.vshost.exe.config" I am able to run the generated ...

Multiple instances of user control with a canvas causes exception in Silverlight

I have a user control that has a grid (the one you get automatically when you create a user control) and a canvas within that. <Grid x:Name="LayoutRoot" Background="White"> <Canvas x:Name="SurfaceCanvas"> </Canvas> </Grid> In the CS file, I've defined an "Items" collection. public ObservableCollection<TestItem> Items { ge...

DataGrid how to get the value of the CurrentCell

I have to access the value that underlies the active cell of a DataGrid (The cell with the black border around it). Luckily DataGrid has a lot of properties such as CurrentCell, CurrentItem SelectedCells SelectedItem and SelectedItems seeming to provide me with the data I want. However I have not figured out how to access the cell in ...

Ellipse default Fill color

Hi, I use an ImageBrush to fill an Ellipse. <ImageBrush Stretch="Uniform" ImageSource="{Binding Image}" /> Since I use uniform stretching my image doesn't fill the whole area of the ellipse and the empty space is transparent. I couldn't find a way to fill it with some other color. Any ideas how to achieve that? ...

How can I change the color of a (Telerik) RadRibbonBar's title text?

I've declared a Telerik RadRibbonBar in my application, but the title window's text is white, and looks like this: In my opinion, it looks pretty bad. Does anyone know of any way to change it? This is the XAML I'm using: <telerikRibbon:RadRibbonWindow x:Class="TestApp.MainWindow" xmln...

MVVM like wizard

Hi, I am currently building an MVVM based application. The application should also have a wizard in MVVM style. The wizard is not a normal wizard, its a particular kind of a wizard. My goal is to implement a wizard with 1.) has also multiple branches. The wizard can guide you in other direction. So the wizard must not be straightforwar...

Caliburn - PropertyChanged for child ViewModel

I'm using Caliburn and the MVVM pattern in a WPF application, and am trying to use as many conventions as possible. One issue I'm running into is when I have to wire-up some property-changed notifications on an imported class. Say I have a ViewModel like so: class ViewModelA { private readonly IViewModelB _b; public ViewModel...

WPF change Button Content on ViewModel.PropertyChanged event

My attempt (below) fails: <Canvas x:Key="Lock" ... /> <Canvas x:Key="Unlock" ... /> <Style x:Key="LockButtonStyle" TargetType="{x:Type Button}"> <Style.Triggers> <DataTrigger Binding="{Binding Path=IsReadOnly}" Value="True"> <DataTrigger.Setters> <Setter Property="Content" Value="{StaticResource...

Way to make a Windowless WPF window draggable without getting InvalidOperationException

Hi, I have a window less WPF main window. I'm trying to make it so that the end user can drag the window. I've added the following to the Window's constructor: this.MouseLeftButtonDown += delegate { DragMove(); }; The problem is, I have a dialog box that opens up with two buttons. When I click one of these buttons, I get an Invali...

Force update of view on validation error using MVVM pattern

Hi! I have the problem: I have some controls on a form (a check-box, a combo-box, a slider, a text-box). Their values are bound to different properties of the view model. When a property of the view model has a certain value, I want these control to be "fixed" (a error message is displayed and they are set to some fixed value (e.g: the ...

Keyboard Navigation is not working.

I have created a TreeViewComboBox control, in this I am having a ComboBox with items as TreeView, but Keyboard Navigation doesn't work on the TreeView. I am not able to navigate through the TreeViewItems using keyboard. Any help plz? ...

where to put StateChanged triggers?

Hi, Where do we put the StateChanged trigger from expressionblend.codeplex.com ? <i:Interaction.Triggers> <sam:StateChanged Completed="True" StateName="BeforeUnloaded"> <... /> </sam:StateChanged> </i:Interaction.Triggers> the above code i tried gave me a compile error saying A value of type 'StateChanged' cannot be added to...

Adding UI Components in C# WPF in Code behind

Hi, I'm new to C# and WPF format. In my program, I have an array of strings with text, and I want to create a button in the canvas for each string in the array. I've used flex, and in that i can use the addChild command to put something in something else, but I haven't figured out how to do it in WPF yet. Any help would be appreciated, t...

Lazy loading WPF tab content

My WPF application is organized as a TabControl with each tab containing a different screen. One TabItem is bound to data that takes a little while to load. Since this TabItem represents a screen that users may only rarely use, I would like to not load the data until the user selects the tab. How can I do this? ...

Resize column header in listview wpf

How can set "AllowUserToResizeRows" property in Header listview wpf? it was in Windows.Forms thus :" dataGridView.AllowUserToResizeRows = false " My xaml code is : <ListView Margin="2.5,0,0,32" Name="listView1" ItemContainerStyle="{StaticResource myItemStyle}" SelectionMode="Single" HorizontalContentAlignment="Center" VerticalAlignmen...

producing ImageData of an EmbededImage in a rdlc file

How can I produce ImageData of an EmbededImage in a rdlc file? note:To select my image I use openfiledialog. ...

Windows Service with WPF management tool

hi, i'm trying to create a windows service with C# in .net that runs before the user is logged on... then when a user is logged on a symbol should appear in the system tray (next to the clock) to show the user that the service is running.. by double clicking that symbol a configuration utility (written in wpf) should be shown to the u...

In WPF how do you write an application for multiple screens?

I have been asked to look into writing an application that will be a very very large application, expanding over 9 screens at (obviously) a very high resolution. My question is, what is the best way to go about doing this? Do I just write an application that is (1024x3) x (768x3)? How on earth can I do that at development time? I won't...

WPF: Can I apply the same style to mulitple items at once?

This is my XAML fragment: <StackPanel Orientation="Horizontal" > <CheckBox Content="Sunday" IsChecked="{Binding Sunday}" Style="{StaticResource ResourceKey=GridChecks}"/> <CheckBox Content="Monday" IsChecked="{Binding Monday}" Style="{StaticResource ResourceKey=GridChecks}"/> <CheckBox Content="Tuesday" IsChecked="{Binding...

Adding a user control "The Enumerator is not valid"

I'm using Visual Studio 2010 to create a small WPF application. I've created a user control that I am now trying to add to my main form. The user control does show up in toolbox but every time I try to drag the control to the form I get the error: The enumerator is not valid because the collection changed. I should know what's wrong ...