wpf

Weird problem where Button does not get re-enabled unless the mouse is clicked

My app is written using the MVVM pattern in WPF, and all of my Buttons use Command bindings to execute code in my model. All commands have code in CanExecute to determine the bound Button's Enabled state. The logic works perfectly, but in all cases, the GUI remains in a disabled state unless I click somewhere else in the GUI. For exam...

How To Get Started With Silverlight ?

I want to start silverlight development inside an application which developed by WPF. Actually we want to add silverlight featuretoan existing WPF project. what should we consider and how todo this I saw Getting started with Silverlight development and it was not my answer I mark this as a Community Wiki. ...

ItemsPanel vs Grid vs GridSplitter

I am currently trying to build a ControlTemplate for an ItemsControl that uses the Grid as its ItemsPanel where each item is stacked horizontally and delimited with a GridSplitter. The basic goal is to have a dynamic bindable ItemsControl where all items stack up in a row and where each item can be resized with a splitter. There are ...

How to write events to checkbox in the WPF toolkit datagrid

I bound my datagrid with database I added a checkbox column to the datagrid Now I want to take some data from the database to another datagrid when I click on the checkbox That is I have to add differnt data from the database when I click on the checkboxes on different rows I searched in several sites then I got the method to do this i...

Composite Commands Not Working

I am working on a Composite MVVM application and trying to get Global Binding events happening - Except it is NOT!.. the buttons are disabled by default although the CanRun returns true!! !! I have followed the Composite Guide and the OnLoadMenu is not firing!!! I have been going around in circles (Event Aggregators, DelegateCommands,...

Does a WPF storyboard animation continue to run when the affected control is hidden?

I am implementing a "marching ants" style animation by applying a StrokeDashOffset animation to a Rectangle control. I would like the animation to play when the rectangle is visible but not take up extra CPU cycles when it's hidden. Is WPF smart enough to automatically pause the animation when the affected control is hidden? ...

ModelVisual3D vs Model3DGroup

Is there any disadvantage of using ModelVisual3D over Model3DGroup. How much can the resource/performance impact possibly be? ModelVisual3D gives me much more than Model3DGroup does but AFAIK everything that can be done with Model3DGroup can alos be done with ModelVisual3D. So why not just always use ModelVisual3D? ...

WPF refreshing control basic question

Hello. I have a very basic question about binding between controls. I have a class that has bunch of fields, lets call it "Style". One of the field is called "Images" with only getter and no setter. Then i have another class "StyleImages" that is called with constructor "new StyleImages (Style)" in getter on class "Style". Meaning that...

WPF - Perform color animation based on previous and current value of a TextBlock

Hi, I have to change the color of a TextBlock to indicate whether the number is positive or negative - red for negative, blue for positive. I have done this by using a DataTrigger and a Converter which returns True/False whether the number is negative/positive. Next requirement is a bit trickier: when the number changes, perform a slow ...

How to pass Command Parameter in WPF?

I want to pass the Button Event Arguments as a CommandParameter on a WPF Button. What would be the syntax I should use? <Button x:Name="btnMain" Command="viewmodel:ApplicationCommands.MyCommand"CommandParameter="{Binding ???}" /> ...

how to insert an image into a database using WPF

I have a WPF question. I have 2 textboxes and an image control in a WPF Form. The image control has an image in it. I want to insert the contents of each of the text boxes and the image in the 3 separate columns in an SQL database. The text boxes feed into varchar columns while the image itself is loaded into a column with datatype ima...

WPF Popup hiding problem

Hi ! Suppose you have a ToggleButton for opening a Popup, same behaviour as all known elements as ComboBox etc. ... which is this code: <ToggleButton x:Name="PART_OpenToggleButton" Focusable="False" IsChecked="False" Template="{StaticResource MyToggleButton}"> <Grid> ...

Does anyone have any stats or thoughts on Performance of WPF on 64bit OS?

I see lot of new machines and laptops now having 64 bit hardware and provided all drivers are correct, will WPF and corresponding .NET will run any faster on 64 bit machines? I dont see any documentation about .NET or WPF on 64 bit anywhere, but I would like to know the difference. I see that .NET has no specific API for 64bit architectu...

tooltip font in wpf

Hi everybody. Does anybody know how to change the font of tooltip for ui elements? ...

Trigger Property on another WPF control event

Suppose I have a ListView and TextBox and they are located in different containers in the same Window. Selecting items in the listview I want the TextBox Text property to be updated in accordance with the listview data bound selected item. Is it possible in XAML? ...

Data Binding with WPF and MVVM/Model-View-ViewModel

I'm having difficulty correctly Data Binding my models in the view. I have a MainWindowViewModel which contains a list of AlbumViewModels. Each AlbumViewModel holds an AlbumModel. So I have multiple albums and I need to display information in an ObservableCollection in the AlbumModel. I have two ListBoxes. ListBox1 holds the list of...

How to set an Image fit to width of ScrollViewer

I've Image placed inside a ScrollViewer. <ScrollViewer x:Name="imageScroller" Grid.Column="2" Margin="5" HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Visible"> <Image x:Name="imageViewer" Cursor="Hand" RenderTransformOrigin="0,0" Margin="0"> <Image.LayoutTransform> <ScaleTransform ScaleX="...

Layout difficulties in ListBoxItem ContentPresenter Template

Good day, I am populating a ListBox withe Shipment objects and I am using an ItemContainerStyle to define how I want the items displayed. Everything is working smoothly with one exception. The template uses a Grid that is inside of two borders. The grid has 7 columns, the last is specified to contain a border that will end up being a...

C# WPF project, how to avoid InvalidOperationException?

We have a WPF project. I got the following error: InvalidOperationException was unhandled The calling thread cannot access this object because a different thread owns it. I try to get value from a TextBox from a worker thread created by me. How to avoid this. I was able to avoid this in another Form project by using delegate call ba...

How to make a WPF Application access online database?

I am developing a simple WPF Application that requires a database. My question is, can I use an online database to run with my application. That is, can my WPF Application access an onlline database? If yes, then how do I do it? Will the conventional way of accessing the SQL Server work? Also, is there any free online database website av...