wpf

In WPF is the UI dispatcher.begininvoke method thread safe?

I have a WPF app that makes use of some multi threading. I am curious to know if calling into the UI thread by using the Dispatcher.BeginInvoke() method considered thread-safe? Normally i would use the lock statement to make sure only one thread can access a variable. Would the following be thread-safe in a WPF app? this.Dispatcher.B...

IsSelected property of ViewModel bound to ListBox, Only FIRST item selection works ?

Hello, I have a MeetingViewModelList bound to a DataGrid. Each MeetingViewModel has a DocumentViewModelList bound to a ListBox within the DataGrid`s DataGridTemplateColumn. The IsSelected property of the DocumentViewModel is bound to the ListBox`s Item property IsSelected. I get no binding errors in the output console. The delete d...

WPF - same style of contexmenu on different operating systems

Hi Is there any way to force context menu to look the same in every operation system (Windows XP Win7 Windows Vista) ?? I installed my small application on windows xp and context menu looks totaly different than I expected. It seems that context menu gets it's look from windows style or something like that. So is there any way to force t...

Create a TextBox similar to MS Outlook email recipient TextBox

Hello, I want create a UserControl that is similar to the MS Outlook 2010 recipient TextBox. As I have never done something similar before I would need some good input/ideas how to achieve that. Just some guidance that I can walk along the route... My requirements are this: Enter the name of a guest like "Ro...." and I got suggested ...

WPF - binding enum type to textbox

Hi I bind textbox.text value to enum type. My enum looks like that public enum Type { Active, Selected, ActiveAndSelected } What I wan't to acomplish is to show on textbox "Active Mode" instead of "Active" and so on. Is it possible to do that? It would be great if I could acomplish that in XAML - be...

Can I bind two methods to a WPF Control?

Hi Guys, I have this combo box <ComboBox Height="23" SelectionChanged="comboBox1_SelectionChanged"> <ComboBoxItem Content="Opt1"/> <ComboBoxItem Content="Opt2"/> </ComboBox> Basically what I need is to run two methods, the one already bound (combobox1_SelectionChanged) and an additional one I cre...

Call the repository`s CRUD-methods from the Controller or ViewModel ?

Hello all, thats the way josh smith is doing the add-a-customer-procedure: **CustomerViewModel**.cs: public void Save() { _customerRepository.AddCustomer(_customer); } **CustomerRepository**.cs: public void AddCustomer(Customer customer) { //... _cus...

How to set/bind ScrollBar.Maximum the right way in XAML?

I have written a custom control MyControl with virtual content that is much wider than the control itself, and I want to make use of the ScrollBar-control to scroll the virtual content of my own control. My control has 3 properties, that are important in this scenario: Width: the physical width of the control VirtualWidth: the width of...

Specify an icon for app with Visual Studio

I am have some trouble specifying a custom icon in my WPF applicaion. I went to Properties/Application and down in resource I pointed towards where the icon is stored (Resources/MyIcon.ico). However when I run the app I get the default icon. Has anyone else seen similar problems? ...

WPF rhombus shape custom control

Hi I have my custom control which looks like that <UserControl BorderBrush="#A9C2DE" HorizontalAlignment="Left" x:Class="Block" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Height="86" Width="151" ToolTip="{DynamicResource BasicTooltip}"> <UserControl.Reso...

I want to disable the shadow effect on a specific aero window

I want to disable the shadow effect on a specific aero window. All I have is the HWND of this window, is this possible? ...

WCF and ASP.NET MVC: Service Too Busy

I've got a WPF application that does a very simple image playlist. It needs to be controlled by a web browser, so I opted for ASP.NET MVC, being familiar with it. If I publish and install the WPF app to my local computer, and run the MVC web app through VS2010 locally, it works perfect. I can control the WPF app via a web browser. ...

WPF: Thumb DragDelta not Working

I wrote a custom adorner for the WPF InkCanvas. It takes over the built-in adorner that InkCanvas provides, and I designed it to do the same things (Select, Resize, Move) the adorned elements. My Thumbs (one on each corner of a Path that has a RectangelGeomoetry locate perfectly. However, the DragDelta code is not operating correctly. ...

Adding to a collection in MVVM

Hi all, I have 2 ViewModels. One is called User (containing basic information, nothing fancy) and another called Group, which has as a property, an IEnumerable of User. This IEnumerable is backed by a dictionary (there are a lot of users, need to search them fast) public class Group { #region Fields private Dictionary<string, Us...

Help debugging WCF

I am new to WCF programming and am finding the learning process rather frustrating. As far as I can tell, WCF (and WPF, for that matter) will hide errors from you by default. So far I have experienced the following problems and had essentially zero indication from Visual Studio or the runtime that there was anything wrong (other than m...

Publish A WPF Application To An Asp.Net Website

I'm using Visual Studio (VS) Professional Edition 2010 and IIS 7. I'd like to publish a wpf application for download from a website. But for some reason, when I go to Build > Publish in VS, select a publishing location, select that users will install the application from a website, and then try to browse to a URL on my machine, VS give...

Open source twain library

Can you advice me open source twain library for scannning with pure good API. ...

Update Dependency Property prior to program exit

I have created a dependency property of type Binary on a RichTextBox which allows me to bind to a FlowDocument which is in binary form (byte[]) within the ViewModel. This works well, the property converts to and back correctly. Whenever the RichTextBox looses focus then the value of the dependency property is updated with the new binary...

using converters

I have to format a string ("00:10:08:10") into (10 weeks 08 days 10 hrs). So I used a converter and added it with the datagrid binding. My code: Public Function Convert(ByVal value As Object, ByVal targetType As System.Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements System.Wind...

WPF Listbox - data binding problem

Hi, I have this problem, when I run application I see listbox with items "red", "blue", "yellow". But when I type "black" to textBox1 and press Button1 item is not added. Any idea why? public partial class Window1 : Window { private static ArrayList myItems = new ArrayList(); public Window1() { InitializeComponent...