wpf

Update ListView when properties of items change

Hi. I want to implement a panel to set user permissions. So i have a PermissionListView where the ItemSource is an ObservableCollection and in this PermissionListView I have a Checkbox for each Item which is bound to PermissionViewModel.Checked. I debugged it and this works. The user gets selected in another ListView(UserListView). But ...

Image shear in WPF

Hello, I am trying to shear an Image in WPF (C#) using pure XAML. I have used transformations such as skew, scale and matrix but I am not getting the result as I want. Following is the code I am using <Image Source="G:\Demo\virtualization\virtualization\img3.bmp" Stretch="Fill" Height="70" Width="240" Margin="0,170,-312,-29" > ...

Strange wpf binding

Hi all, I have a problem with bindings in wpf. I've discovered a strange problem. I have class ConfiugrationStringBuilder which inherits from DbConnectionStringBuilder. When I do smth like this public class ConfiugrationStringBuilder : DbConnectionStringBuilder { public string Directory { get;set; } } ConfiugrationStringBuilder buil...

Place an Image into ViewPort3D in wpf.

Hi I am having problem in displaying th Image in viewport3d of wpf. <Grid> <Image Source="G:\Demo\virtualization\virtualization\2.jpg"/> <Viewport3D Name="mainViewport" ClipToBounds="True" HorizontalAlignment="Stretch" Height="300"> <Viewport3D.Camera> <PerspectiveCamera LookDirection="0,0...

Difference between Image URI behaviour in code and in XAML

Hi, I have an Image declared in some XAML as: <Image Width="188" Height="56" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="10,0,0,10" Grid.ColumnSpan="2" Grid.Column="0" Source="..\Images\myImage.png" /> This is a static image and does not need to change during program execution. I also have an image which does need...

Change a style dynamically in WPF

Is there a way to change(and apply) a style dynamically in WPF? Say I have the style declared in XAML: <Style TargetType="local:MyLine" x:Key="MyLineStyleKey" x:Name="MyLineStyleName"> <Setter Property="Fill" Value="Pink"/> <Style.Triggers> <Trigger Property="IsSelected" Value="true"> ...

How add new row to wpfToolkit:DataGrid (in code)

I have xaml: <my:DataGrid x:Name="p_tempDataGrid" Grid.Row="2" Grid.ColumnSpan="7" > <my:DataGrid.Columns> <my:DataGridTextColumn Header="Имя" Width="*"/> <my:DataGridTextColumn Header="Дата" /> <my:DataGridTextColumn Header="Коментарии" /> <my:DataGridTextColumn Header="Цена" /> <my:DataGrid...

Create a slide down animation/storyboard for an element?

I'd like to create a slide-down animation for an Grid element in my WPF (.net 4.0) application. I assumed that I could do the following: create a visual state (closed, renderTranslate.y=-ActualHeight, solved via Binding with converter) create a visual state (open, renderTranslate.y=0) create a container to clip the animation use the de...

WPF ComboBox SelectedIndex changes when IsEnabled is set to false

I am creating an application using the MVVM pattern and somewhere I have a view which contains a ComboBox. <Controls:SettingsComboBox x:Name="Setting" SelectedIndex="{Binding SteeringIndex, Mode=TwoWay}" IsEnabled="{Binding SteerAttached, Mode=TwoWay}"> <ComboBoxItem Content="{Binding Path=on, Source={x:Static Localization:C...

How can I find out, whether a certain type has a string converter attached?

Here is the problem: I have a property of a certain object. This property is of Type t. I need to find out, if a string value can be attached to this property. For example: I have an instance of a Windows.Controls.Button. I need a mechanism, that will return true for property Button.Background, but false for Button.Template. Can anybo...

How to make a Binding in code?

<Custom:DataGrid Grid.Row="1" Background="{x:Null}" x:Name="datagrid" DataContext="{StaticResource dataSetPartner}" ItemsSource="{Binding Partner}".... and <ObjectDataProvider x:Key="dataSetPartner" MethodName="PartnerStat" ObjectType="{x:Type loc:DataSetCreator}" />...

WPF Control Template Trigger, how to reference sub object

I have AnswerContainer class which is inherited from ContentControl. The AnswerContainer has a public dependency property called Answer. public class AnswerContainer : ContentControl { public static DependencyProperty AnswerProperty; public Answer Answer { ... Answer property is of type Answer and has a public dependen...

WPF: Setting Foreground of a Label inside a TabItem Header using styles

Hello, I have a TabControl which looks like this: <TabControl> <TabItem> <TabItem.Header> <StackPanel Orientation="Horizontal"> <Canvas ... /> <Label>Tab Number 1</Label> </StackPanel> </TabItem.Header> </TabItem> <TabItem> <TabItem.Header> <StackPanel Orientation="Horizontal"> ...

WPF WebBrowser Control: What browser does it use ?

Hi, Does the WPF WebBrowser control always use Internet Explorer or does it use the default web browser on the system ? Regards, MadSeb ...

WPF Table Column Sizes

I'm rendering a Table in a WPF FlowDocument using code-behind. But, I've been unable to find an example that shows how to make the table use only the space needed based on content. Instead the table takes up all available width, which I don't want, nor do I want to have to specify a exact pixel sizes. I'm clearly missing something simp...

Permission Denied - Cross process UI using .NET Remoting and FrameworkElementAdapters

Hi folks, My question is very similar, if not a replica of this one. Irritatingly, the 'answer' doesn't give me a whole lot to work with and frankly I'm at a loose end. The problem should be fairly obvious. I want to pass WPF elements between processes for a pluggable application framework without having to use Managed AddIn Framework....

WPF StringCollection + TextBox

ApplicationSetting: RenameSettings - System.Collections.Specialized.StringCollection - User - *wall of text" <Application x:Class="app.App" ... xmlns:properties="clr-namespace:app.Properties" StartupUri="MainWindow.xaml"> <Application.Resources> <properties:Settings x:Key="Settings" /> </Appli...

WPF ComboBox get displayed text

I'm having a problem with my combo box and trying to get the text that is displayed in the box. I have the ItemsSource bound to a SqlDataReader, and I'm trying to populate another combo box based on what item is selected in the first combo box. In the first combobox's selection changed event, I'm running a query based on what's selected...

How to enable MS-SQL Compact Database encryption on first program run when using it with the Entity Framework?

OK, here is the szenario: I'm coding a .NET 3.5 WPF-Aapplication, using the Microsoft Entity Framework to use a compact database file (.sdf) for storing data. On my first program start a computer-based encryption key is calculated and saved into the registry and my sdf-File should become encrypted with this key (or rather with a somehow...

How to display values as images in GridViewColumn?

Hi, I have a GridViewColumn which I have bound as so: <GridViewColumn Header="Validated" DisplayMemberBinding="{Binding Path=Validated, Converter={StaticResource imageConverter}}" /> The Binding Path = Validated returns an Enumerated value, the imageConverter takes that value and returns a System.Windows.Media.Imaging.BitmapImage. I ...