wpf

Is there a WPF equaivalent to System.Windows.Forms.Screen?

I'm trying to create a WPF window that will encompass the entire Desktop working area. In WinForms I'd do this by getting the Union of all the bounds in System.Windows.Forms.Screen.AllScreens. Is there an equivalent type or other mechanism to get the bounds of the entire desktop in WPF or do I need to use the WinForms type? ...

Can WebClient() download more than one string at the same time? (C#)

I mean can I do something like this: var client = new WebClient(); var result = client.DownloadString(string("http://example.com/add.php"); var result2 = client.DownloadString(string("http://example.com/notadd.php")); in paralel like for 100 url's ? ...

JpegBitmapEncoder.Save() throws exception when writing image with metadata to MemoryStream

I am trying to set up metadata on JPG image what does not have it. You can't use in-place writer (InPlaceBitmapMetadataWriter) in this case, cuz there is no place for metadata in image. If I use FileStream as output - everything works fine. But if I try to use MemoryStream as output - JpegBitmapEncoder.Save() throws an exception (Except...

Can I have multiple colors in a single TextBlock in WPF?

I have a line of text in a textblock that reads: "Detected [gesture] with an accuracy of [accuracy]" In WPF, is it possible for me to be able to change the color of the elements within a textblock? Can I have a textblock be multiple colors? For example, I would like the whole TextBlock to be black except the gesture name, which I wo...

Data-binding taking too long to update

In my application I have this code in my view model: hiddenTextContainer.PreHideVerticalOffset = VerticalOffset; hiddenTextContainer.HiddenText = Text.Remove(SelectionStart, SelectionLength); hiddenTextContainer.HasHiddenText = true; hiddenTextContainer.NonHiddenTextStart = SelectionStart; ...

WPF: Master - detail view with two datagrids and in MVVM

Hi, I'm trying to write a master - detail control that consists of a master datagrid and the detail datagrid. My scenario was following - I used the SelectedItem and bound it to a property in ModelView. The problem is - the SelectedItem in ViewModel is never used, so I can't get the information which item is selected in a master datagrid...

What are the real-world benefits of declarative-UI languages such as XAML and QML?

I'm currently evaluating QtQuick (Qt User Interface Creation Kit) which will be released as part of Qt 4.7. QML is the JavaScript-based declarative language behind QtQuick. It seems to be a very powerful concept, but I'm wondering if anybody that's made extensive use of other, more mature declarative-UI languages like XAML in WPF or Sil...

Why is my namespace not recognized in Visual Studio / xaml

Hello, these are my 2 classes a Attachable Property SelectedItems: code is from here: http://stackoverflow.com/questions/1297643/sync-selecteditems-in-a-muliselect-listbox-with-a-collection-in-viewmodel The namespace TBM.Helper is for sure proper as it works for other classes too. The namespace reference is also in the xaml file AND ...

Bind Command to MenuItem

Hi I have ListView and i am trying to bind command to ContextMenu of ListView. <ListView x:Name="listView1" ItemsSource="{Binding Path=Persons}"> <ListView.Resources> <ContextMenu x:Key="ItemContextMenu"> <MenuItem Header="Add" /> <MenuItem Header="Edit"/> ...

Adding different context menu for datagrid's header

Hi, I want to add a different context menu for my datagrid's header on WPF. How can I do that? ...

MVVM- Is there any way I can bind the visual of a visual brush to another window?

I have a settings window and am trying to set it up so that there is a live preview what the main window will look like with the current settings. Here is a picture of what the settings dialog looks like at the moment. The big black rectangle will be the preview. ...

MVVM- How would I go about propagating settings between my main view-model (and other view-models) and my settings dialog?

I am building a settings dialog for my application and right now all of the settings correspond with settings on the main view-model, but as I add more view's and view-models some may not. I need to know what the best practice is for loading the current settings into the settings dialog and then saving the settings to thier correspondi...

WPF: change DataTemples according to Value

I have a class called Cell with two properties. One is called Value of type int? And the other is called Candidates of type ObservableCollection<ObservableCollection<Candidate>> during the initialization I am utilizing a DataTemplateSelector to choose between two datatemplates for two different scenarios. If the Value property has a va...

WPF in an MMC snapin

Can someone provide some sample code for using WPF in a custom MMC snapin? I'm new to WPF, and I've understood the samples for writing MMC snapins, but I do not understand how to choose WPF instead of Winforms. ...

[WPF Datagrid] Binding to a List<>

I have a datagrid like this: <dg:DataGrid Name="dg" AutoGenerateColumns="False" CanUserDeleteRows="True"> <dg:DataGrid.Columns> <dg:DataGridTextColumn Header="Product Code" x:Name="columnProductCode" Binding="{Binding Path=Product.ProductCode}" IsReadOnly="True" ></dg:DataGridTextColumn> ...

Multiple bindings expressions in one statement

Does WPF support multiple binding expressions in one statement? Something along the lines of the following: <TextBlock Text="{Binding Path=OrderID} shipped on {Binding Path=OrderDate}"/> I'm guessing that it does but I think I just don't have the correct syntax. ...

Has anyone noticed that a WPF file dialog will pass a click through to the UI when double clicking to select a file?

I have some buttons on my WPF UI and I also need to choose files from time to time. I kept noticing strange problems where when I double-click an item in the file dialog, a button on the main UI would also get clicked. After experimenting, it seems that if you line up an item in the file dialog with a button behind it on the main UI an...

WPF Binding Error reported when Binding appears to work fine

I am trying to create a custom TabItem template/style in my WPF 4.0 application (using VS 2010 Pro RTM), but inspite of everything seeming to work correctly, I am noticing a binding error in the trace window. The resource dictionary XAML I use to style the TabItems of a TabControl is given in full here. (Just create a simple TabControl ...

Why no classic report generator for xbap(WPF)

I can not find a specific solution for report generation in XBAP or maybe WPF. has a classic solution? (or best solution) example: Use Crystal Or Microsoft Report through ASPX pages. convert report pages to portable formatted such as photo and send to XBAP app. or ... suppose the user is familiar with classic solution. ...

Is it possible to use Kit3D in WPF? If so, how?

I have a Silverlight application that uses Kit3D and I want to convert it to WPF. How would I do that? Should I do that? ...