wpf

MS DataGrid (WPF) : How to bind a combobox to a class?

This might sound like a trivial question, but even here in Stackflow I only have found binding to a simple string collection. I have a Parent class with two properties Name and Age. I have a Child class with two properties ChildName and ChildAge. Within MVVM pattern I am exposing these properties into the ViewModels and additionally I...

How to create a xaml databound report in WPF?

I want to create a report that can be printed, exported as PDF or Word document. All of the reporting frameworks I've seen so far, insist on creating a connection to database directly which is absurd. My data comes from WCF service inform of an object. Following is the structure of object. ReportData { public UserInformation Basic...

How select Text in TextBock?

I only found a way to: <TextBox Text="Text!" IsReadOnly="True" IsTabStop="False" BorderThickness="0" > <TextBox.Style> <Style TargetType="{x:Type TextBox}"> <Style.Triggers> <MultiTrigger> <MultiTrigger.Conditions> <Condition Property="IsMouseOver" Va...

button_click event inside Viewport2DVisual3D does not execute

Hello. I have a button element inside Viewport2DVisual3D element, but wpf does not execute the event. I am only able to execute the Viewport3D_MouseDown event (Button_Click_1). What am i doing wrong? <ModelVisual3D> <Viewport3D Margin="2,-18,-2,18" MouseDown="Viewport3D_MouseDown"> [...] <Viewport2DVisual3D.Vis...

Controlling XAML tags from C# code

Hi , everyone I have a WPF application , and I would like to modify the background color of the UI based on the user's selection at run time . Now , I want to create a button that changes the color each time its clicked , so this button must change a value from the XAML tags Please , help me doing it , I need it badly Thanks ...

Getting many Binding "Information" in WPF output window

When I start my app I get alot information like this: System.Windows.Data Information: 10 : Cannot retrieve value using the binding and no valid fallback value exists; using default instead. BindingExpression:Path=Period; DataItem=null; target element is 'TextBlock' (Name=''); target property is 'Text' (type 'String') System.Windows.Da...

Can't render pixel shader to RenderTargetBitmap! Please help!

Hello - I wrote a very simple WPF application to test the ability to render a control that has an associated pixel shader to a RenderTargetBitmap. I then write the bitmap to file (jpeg). The control is rendered onto the bitmap, however the pixel shader effect is not applied to the control. The code and the XAML is below: namespace...

wpf listbox dataBinding

i have a listbox who takes values from Dictionary Size: this is the Size type: public Dictionary<string, int> Size { get; private set; } this is my listbox <ListBox x:Name="boardSize" ItemsSource="{Binding Size}" ItemTemplate="{DynamicResource DataTemplate1}" /> this is my the associated DataTemplate: ...

Useful lighting of a single-colored 3D object in a WPF Viewport3D

I have a 3D Modell of a house, where the roof is invisible so that the rooms can be seen (like here) But (for now) I have no textures and each surface has the same color, e.g., var myMaterial = new DiffuseMaterial (new SolidColorBrush(myColor)) If I view it in a WPF Viewport3D, I want to be able to differentiate between the surfaces....

Infinite Loop when binding slider in MVVM

I have a video progress slider in XAML thus: <Slider Minimum="0" Value="{Binding Position,Mode=OneWay}" Maximum="{Binding Duration}" IsMoveToPointEnabled="True"/> And code in my viewmodel to update Position on Clock.CurrentTimeInvalidated(), which keeps the slider tracking current progress: private void Play() { Uri next = _carousel....

Looking for simple MVVM Light example

I'm trying to learn MVVM Light and am looking for a good basic example that shows a model and how to load different views. The template I see after downloading MVVM Light has no models and only one view. (http://www.galasoft.ch/mvvm/creating/) Other things I've found are more complex and a bit confusing when all I want to see are the...

CommandBinding question. How to enable command button

My code is here>> public class Player:INotifyPropertyChanging { string addressBar; public string Url { get { return addressBar; } set { addressBar = value; OnPropertyChanged("Url"); } } public Regex regVillage = new Regex(@"\?doc=\d+&sys=[a-zA-Z...

passing listbox item index as parameter to objectdataprovider

Hey guys, I am currently attempting to use an object data provider to return the colour that I would like to use as a background for each listbox item, with the colour dependent on that listbox items index. Basically the parameters passed to the object is the original colour and the listboxitem index, and it will return a colour that i...

ItemPropertyChanged not working on observableCollection.Why?

Hi, I have searched high and low for a solution but I dont seem to get to the bottom of it. Like many posts on the net I dont seem to make my itemPropertyChanged work. It does not fire when editing an item in the collection.Why. a bit lenghty but this is an example I have put together. I have a customerViewModel that contains a Collec...

Add byte[] to resources in wpf c#

Hi, I have 3 bitmap images each of around 28-30 MB. My application needs to access pixels from these images frequently. Currently I am creating BitmapData of all 3 files, locking them and then reading all the pixels in 3 different byte[]'s. Following is the code for one image: System.Drawing.Imaging.BitmapData bmpData = result.LockBits...

Multiple Storyboards with alternating Visibility of animated visuals

Let's say I have a custom control that I want to animate on loading and closing. I have overridden its ControlTemplate and provided Storyboards for show/hide animations. Loading is handled with EventTrigger on Framework.Loaded and closing on a custom event. This all works well. Now I have a series of images that I want to display consec...

WPF 4.0 Application load error in some environments

I have 4 environments: Win 7 64 bit Win 2003 32 bit Win XP SP3 32 bit Win 2003 64 bit In the first 2, my app loads and runs successfully. In the latter 2, I get the following error (shortened): System.Windows.Markup.XamlParseException: The method or operation is not implemented. ---> System.NotImplementedException: The me...

WPF, DataGridRowHeader, binding to collection

Hello! I have a simple DataGrid. I want to make that every DataGridRowHeader has it own Content. I specified RowHeaderStyle like this: <DataGrid.RowHeaderStyle> <Style TargetType="DataGridRowHeader"> <Setter Property="Content" Value="{Binding Source={StaticResource RowHData}, Path=Parameters}"/> </Style> </DataGrid.RowHeader...

Layout in silverlight

I am running into a layout issue which I am not sure how to solve. Here is how my xaml looks like, <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <Grid x:Name="abc" Grid.Row="0" Grid.Column="0"> <Grid> <Grid.ColumnDe...

Can I access the StartupEventArgs from anywhere other than the App_Startup event handler?

Are the command line parameters accessible from anywhere in the application other than the App_Startup event handler? Can I get to them through something like App.Current? ...