wpf

wpf binding by selected value - swap out bound object without disturbing binding

Hi, I've got combo box bound to a custom collection type - its basically an overridden ObservableCollection which I've added a facility to update the underlying collection (via Unity). I don't want to confuse the issue too much, but thats the background. My xaml looks like this <ComboBox ItemsSource="{Binding Manufacturers}" DisplayM...

SSRS - DataSource Instace has not been supplied for dataset 'dataset1'

Hie Everyone I have 1st time developed SSRS in my WPF application.. but there is problem in report viewing.. it gives error DataSource Instace has not been supplied for dataset 'dataset1' I have done following steps 1. develope ssrs 2. create windowsFormHostControl in XAML 3. get new reportviewer in code 4. reportviewer.processin...

Creating instances of resources?

I'm brand spanking new to WPF and am trying to play around with projects to better understand what I'm reading. My understanding of a resource is that it is the instance, you can't use it like a factory and create instances of it. For example, a XAML-defined rectangle. You can reference it, but you can't have numerous instances of it ...

Why do my WPF UIElements NOT have OnPreview events?

I'm building a custom Silverlight UserControl which needs to listen to events using Preview/Tunneling, but for some reason the compiler is telling me they are not recognized or accessible. For example, I can add an event handler to MouseLeftButtonDown, but not PreviewMouseLeftButtonDown. This doesn't make sense because according to Micr...

3d Models in WPF

Hi folks my Question is simple 1-How can i get a file with .3ds or .obj ... extension loaded in wpf project 2- how can i do drag and drop that 3d model with mouse .(i'm doing a 3d chess project ) ...

WPF - Rotate and Save Image -both for the View and to Disk

Hello, I have a View that contains an image control. <Image x:Name="img" Height="100" Margin="5" Source="{Binding Path=ImageFullPath Converter={StaticResource ImagePathConverter}}"/> The binding uses a converter does nothing interesting except set BitmapCacheOption to "OnLoad", so...

Is there a cleaner way to Bind property to owner's DataContext?

I have some code that looks like this: <Expander Header="{Binding SelectedSlot.Name}" Visibility="{Binding ShowGroupSlot, Converter={StaticResource BooleanToVisibility}}"> <Controls:GroupPrototypeSlotControl Slot="{Binding DataContext.SelectedSlot, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x...

Need to replace 3rd party WinForm controls, what's the closet WPF equivalent?

I am tired of Windows Forms...I just am. I am not trying to start a debate on it I am just bored with it. Unfortunately we have become dependent on 4 controls in DevExpress XtraEditors. I have had nothing but difficulties with them and I want to move on. What I need now is what the closet replacement would be for the 4 controls I am ...

WPF: How to justify all lines within paragraphs (lines with line breaks too)

Hello, i have a some paragraphs within a FlowDocument, and what i need is to justify all lines (even lines with line breaks) Here's a code sample: <Paragraph TextAlignment="Justify"> "One of the most important operations necessary when text materials are prepared for printing or display is the task of dividing long paragraphs into in...

mvvm - prismv2 - INotifyPropertyChanged

Since this is so long and prolapsed and really doesnt ask a coherent question: 1: what is the proper way to implement subproperties of a primary object in a viewmodel? 2: Has anyone found a way to fix the delegatecommand.RaiseCanExecuteChanged issue? or do I need to fix it myself until MS does? For the rest of the story...continue on....

WPF: Order of stretch sizing

I'm creating a modal dialog window which contains three essential parts: a TextBlock containing instructions, a ContentControl for the dialog panel, and a ContentControl for the dialog buttons. Each of these parts are contained in a separate Grid row. I have some specific constraints when it comes to how the dialog should be sized. The ...

Assigning the Tag Property of a Control in WPF

If I have 7 checkBoxes, one for each day of the week, Can I assing in XAML the Tag property to each one of the the System.DayOfWeek enumeration value? <StackPanel > <StackPanel.Resources> <system:DayOfWeek x:Key="Monday" >Monday</system:DayOfWeek> </StackPanel.Resources> <CheckBox Name="chkMo" Tag="{StaticResource Monday}...

How to create XAML like path bindings in C#.

The XAML {Binding} construct is very handy because it handles all of the PropertyChanged issues automatically. It is really impressive when you hand it a path to an object, through .NET data structures, and everything is automatically updated for you. I would like to use the same thing in C#. I would like to have a property that is de...

WPF: Show Panel on Right-click

I'm trying to have a WPF ViewBox 'appearing' at the cursor position in a user control when the user right-clicks on the control. Right now, I have the code: <!-- XAML --> <Viewbox Width="100" Visibility="Collapsed" x:Name="actionBox"> <StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch"> <Button>Item ▼</Button>...

BeginInvoke on ObservableCollection not immediate.

In my code I subscribe to an event that happens on a different thread. Every time this event happens, I receive an string that is posted to the observable collection: Dispatcher currentDispatcher = Dispatcher.CurrentDispatcher; var SerialLog = new ObservableCollection<string>(); private void hitStation_RawCommandSent(object...

Stop silverlight or wpf usercontrols from loading in the toolbox?

I have a project with 100's of usercontrols. When I load the project in VS2010 and try to open a designer, the toolbox spins and spins until they're all loaded. Winforms has a "AutoToolboxPopulate" switch under Tools/Options/Winddows Forms Designer/General. I cannot find a similar switch for the XAML designer. Does one exist? ...

WPF Inner Property Binding not updating.

I have an INotifyProperty Screen item that I have bound to a wpf control. Ok... I Simplified everything and am posting more code. I have a MainViewModel with the selected screen property. public Screen SelectedScreen { get { return this.selectedScreen; } set { this.selectedScreen = value; ...

WPF DataGrid duplicates new row when the newly added item is attached to the source collection.

<Page> <Page.Resources> <data:Quote x:Key="Quote"/> </Page.Resources> <tk:DataGrid DataContext="{Binding Quote}" ItemsSource="{Binding Rooms}"> <tk:DataGrid/> </Page> Code: Private Sub InitializingNewItem _ (sender As DataGrid, _ ByVal e As InitializingNewItemEventArgs) _ Handles...

Graphical net and text

Hello! My task is to make a control, that behaves itself like RichTextBox, but contains a graphical net. The only task, this net is solving, is to be visible. It should be solution in overriding OnPaint method, but it doesn't. This code: protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) { base.OnPaint(e); ...

How to get the Grid.Row Grid.Column from the selected added control?

How to get the Grid.Row Grid.Column from the added control? Basically I have 16 grids with 4 rows and 4 columns, each grid is added a round button. how to determine which rows and columns the selected round buttons are located respectively in the below MouseEventHandler of mouseover? For mouseclick, there is only round button selected...