Great. Enjoy :-D
MVVM devotee :)
Great. Enjoy :-D
MVVM devotee :)
Hi, Here is the Click Event handler which i said private void Link1_Click(object sender, RoutedEventArgs e) { string id= ((sender as HyperlinkButton).DataContext as YourBusineesObject).HiddenID; } Let me know if this works.
MVVM devotee :)
Hi, Its simple. Just get the data context of your hyperlink button or combobox, and get the business object property to get the actual value which you bound with textblock. Hope you can get my point.
MVVM devotee :)
Yes. You can just use the same converter. make sure that your converter always returns Visibility type instead null or string.
MVVM devotee :)
Hi, Yes. Just go ahead with XBAP application which enables your application as desktop application without any performance issue.
MVVM devotee :)
Hi Barry, This is by design. Designer never look for the code behind of your current class. If you want provide designer support, move all your property declaration from your current class to another class and inherit to your current class. For example, create extended window with your property like below mentioned. public class ExtendedWindow : Window { public static readonly DependencyProperty FileNameProperty = DependencyProperty.Register("FileName", typeof(string), typeof(ExtendedWindow)); public string FileName { get { return (string)GetValue(FileNameProperty); } set { SetValue(FileNameProperty, value); } } }
Now inherit this extended class to your MyWindow class public partial class MainWindow : ExtendedWindow { public MainWindow() { InitializeComponent(); } private void buttonTest_Click(object sender, RoutedEventArgs e) { Microsoft.Win32.OpenFileDialog d = new Microsoft.Win32.OpenFileDialog(); if (d.ShowDialog() == true) this.FileName = d.FileName; } private void buttonToggle_Click(object sender, RoutedEventArgs e) { this.FileName = "Toggle clicked."; } }
Xaml
<local:ExtendedWindow x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:WpfApplication1"
Title="MainWindow" Height="350" Width="525"
x:Name="root">
<StackPanel>
<DockPanel>
<Button DockPanel.Dock="Right" Height="23" Click="buttonTest\_Click">Browse...</Button>
<TextBox DockPanel.Dock="Left"
Height="23" Margin="0,0,2,0" Name="textBoxFileName" Text="{Binding ElementName=root, Mode=TwoWay, Path=FileName}"/>
</DockPanel>
<DockPanel>
<TextBlock DockPanel.Dock="Bottom" Text="{Binding ElementName=root, Mode=TwoWay, Path=FileName}"></TextBlock>
<Button DockPanel.Dock="Bottom" Name="buttonToggle" Click="buttonToggle\_Click">Toggle...</Button>