wpf

block script debugging for wpf browser control

I have used browser control for my WPF browser application.I want to disable the script error message.Please let me know exactly as I am very new to this application. Thanks in advance. Answer other than disabling script message on advance tab of internet option. ...

PasswordBox Binding

I'm just getting started with M-V-VM and WPF and having issues understanding some binding issues. I have a login page that has a ComboBox and PasswordBox. The ComboBox looks like this: <ComboBox Name="comboBox1" SelectedItem="{Binding Path=Username}"> This works just fine - my values get updated everytime the SelectedItem changes on...

Create a custom click event handler for a WPF usercontrol which contains a button?

Hello guys have you ever found a problem when assigning a click event handler for your custom WPF usercontrol with a nested button control? I do. When you put such user control in a main window, let's say Main.xaml, the MouseLeftButtonDown doesn't work, but the PreviewMouseLeftButtonDown works like a charm. But imagine yourself tellin...

Clip a wpf Popup at bounds of a main window

From what I understand, the popup exists within it's own visual tree. However, I've noticed a few properties, Clip and ClipToBounds. What I am wanting to do is Visually clip a popup at the right and bottom edges of a window regardless of the fact that the popup is independent of the bounds of the window. I'm not using XAML, but if somebo...

What advantages are to be had by using Java+Swing over C#+WinForms/WPF?

There is a group here using Java, server-side and client-side, with Swing for the client UIs. I plan to suggest that they change the front end to C# and WinForms or WPF, but I want to come prepared with: A list of benefits to be had from moving to Winforms / WPF from Swing, A list of Swing benefits that might get thrown back at me ove...

Perfect Center on WPF Canvas

Since the canvas requires a Top/Left for placement, if you want to center something, is adding a grid at the proper Canvas.Top with HorizontalAlignment="Center" the best way to do it, or is there a better way? This snip is a 150X300 canvas, with some content centered in a grid .... <Canvas Width="150" Height="300"> <Grid Canvas.Top...

Can't bind command from Menu Item to a Command Binding

I've got the following xaml: <Window x:Class="Isolator.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Isolator" Height="394" Width="486" Background="Black" WindowStyle="None" WindowState="Maximized"> <Window.CommandBindings> ...

WPF: Is it possible to bind a Canvas's Children property in XAML?

I'm a little surprised that it is not possible to set up a binding for Canvas.Children through XAML. I've had to resort to a code-behind approach that looks something like this: private void UserControl_Loaded(object sender, RoutedEventArgs e) { DesignerViewModel dvm = this.DataContext as DesignerViewModel; dvm.D...

Setting TextBox.Width="*" via Code

Hi, Does anyone know how to set the TextBox.Width property to fill up the remainder of the parent container in code? In Xaml, I would simply set the Width property to *, but I can't figure out how to do this in code. Thanks, Roy ...

WPF: Skinning with Images

There are a lot of samples around showing how to skin WPF applications using DynamicResources and ResourceDictionaries loaded dynamically from .xaml files. My problem is that my skins use images and I would like to include the style definitions and the images in a single file, so that a user only needs to download this. Any ideas how t...

WPF Cascading ComboBoxes

I am successfully databinding and using WPF Comboboxes and have had some success with cascading some of the Comboboxes by triggering the update on the child combo when the parent combos SelectionChanged event is triggered. My combos are cboCountry, cboCity and cboTown. However, this isn't reliable as it seems to blank the selected value...

Click-Once - How to encrypt connection strings

I have a WPF application with connections strings stored in the App.config. What is the best way of encrypting these connection strings in a click-once deployment? Thanks ...

(WPF) Binding two classes to a control

I have two viewmodels. One which displays a collection of IPAddresses, and one which displays a collection of objects that has numerous parameters. One of these parameters is an IPAddress. So, I have another panel that binds to the properties of the second object. I would like a combobox to have the ItemSource set to the first object, bu...

Where does the presentation logic go for the View-Model-ViewModel pattern?

In the View-Model-ViewModel, actions are essentially executed by the viewmodel that is bound to the view. However, where would the "presentation logic" go since the code behind isn't used and the viewmodel has no reference or knowledge of the control that invoked it? For example, what if I wanted to animate another control when a button...

c# How to change window focus onMouseEnter event

Hi, i have a WPF application that i would like to become the current focused window whenever the mouse cursor moves over it. Currently i have a onMouseEnter event that changes the cursor when the mouse moves over it so i know the system is recognizing that, however what i actually want is for the application itself to become focused as i...

Save to PDF in WPF.

Hi All , i have a report and i print it using PrintVisual ,now i need to save it in PDF file but i don't know how export it in PDF. Do you know how i can do it? Thanks for your attention. Nice Regards :) ...

Textbox contains only alphabetic, numerals and space.

Hoe can I ensure that a user can only enter alphanumeric and space in a textbox on KeyDown event in WPF? No special characters allowed. ...

WPF: Customize a datatemplate using a binding property

Hi, I'm very new in WPF. I've got a ListBox where I want to set a template for an item (I called it Person). A TextBlock is to be used. The person has to public Properties: "Foreground" and "IsOnline". If "IsOnline" is true, I would use the "Foreground" property of the person, otherwise "Gray". That's all. My first template is: <DataTe...

Focus the controls in a Tabcontrol.

How can focus the controls when select a tabitem in a tabcontrol? ...

How to increase the performance of WPF Application

I have developed WPF Application. In that application iam loading 200mb photos to the listbox.After that Iam adding those images to canvas.While adding photos to canvas after sometime (i.e; after adding 10mb images)iam getting Some error like ---- The CLR has been unable to transition from COM context 0x10b46f0 to CO...