Click here to Skip to main content
15,921,452 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Have I done something REALLY dumb? Pin
Mycroft Holmes27-Nov-15 12:34
professionalMycroft Holmes27-Nov-15 12:34 
GeneralRe: Have I done something REALLY dumb? Pin
Gerry Schmitz27-Nov-15 14:20
mveGerry Schmitz27-Nov-15 14:20 
Questionhow to find progress bar inside listview in wpf Pin
Member 1021435721-Nov-15 21:12
Member 1021435721-Nov-15 21:12 
AnswerRe: how to find progress bar inside listview in wpf Pin
Joseph M. Morgan18-Dec-15 7:19
Joseph M. Morgan18-Dec-15 7:19 
QuestionWPF Understanding Routed Events Pin
Kevin Marois3-Nov-15 7:12
professionalKevin Marois3-Nov-15 7:12 
AnswerRe: WPF Understanding Routed Events Pin
Richard Deeming3-Nov-15 7:29
mveRichard Deeming3-Nov-15 7:29 
QuestionHow to Change Silverlight Datepicker Format as 'dd/MM/yyyy' Pin
suchitagorivale1-Nov-15 18:18
suchitagorivale1-Nov-15 18:18 
AnswerRe: How to Change Silverlight Datepicker Format as 'dd/MM/yyyy' Pin
Mycroft Holmes1-Nov-15 22:05
professionalMycroft Holmes1-Nov-15 22:05 
QuestionListbox itemtemplate binding Pin
Saurabh18cs22-Oct-15 23:07
Saurabh18cs22-Oct-15 23:07 
AnswerRe: Listbox itemtemplate binding Pin
Gerry Schmitz23-Oct-15 7:55
mveGerry Schmitz23-Oct-15 7:55 
GeneralRe: Listbox itemtemplate binding Pin
Saurabh18cs23-Oct-15 16:19
Saurabh18cs23-Oct-15 16:19 
GeneralRe: Listbox itemtemplate binding Pin
Gerry Schmitz23-Oct-15 17:21
mveGerry Schmitz23-Oct-15 17:21 
GeneralRe: Listbox itemtemplate binding Pin
Saurabh18cs23-Oct-15 20:19
Saurabh18cs23-Oct-15 20:19 
GeneralRe: Listbox itemtemplate binding Pin
Gerry Schmitz24-Oct-15 5:35
mveGerry Schmitz24-Oct-15 5:35 
QuestionWPF ListBoxItem Quick Question Pin
Kevin Marois16-Oct-15 8:17
professionalKevin Marois16-Oct-15 8:17 
SuggestionRe: WPF ListBoxItem Quick Question Pin
J. Calhoun2-Nov-15 6:22
J. Calhoun2-Nov-15 6:22 
QuestionSelectionChanged event is not working Pin
Ashfaque Hussain15-Oct-15 1:52
Ashfaque Hussain15-Oct-15 1:52 
AnswerRe: SelectionChanged event is not working Pin
Richard Deeming15-Oct-15 2:48
mveRichard Deeming15-Oct-15 2:48 
QuestionCheckbox IsChecked property is not binding Pin
Ashfaque Hussain14-Oct-15 2:01
Ashfaque Hussain14-Oct-15 2:01 
AnswerRe: Checkbox IsChecked property is not binding Pin
Richard Deeming14-Oct-15 2:31
mveRichard Deeming14-Oct-15 2:31 
GeneralRe: Checkbox IsChecked property is not binding Pin
Ashfaque Hussain14-Oct-15 19:32
Ashfaque Hussain14-Oct-15 19:32 
AnswerRe: Checkbox IsChecked property is not binding Pin
Meshack Musundi14-Oct-15 23:54
professionalMeshack Musundi14-Oct-15 23:54 
GeneralRe: Checkbox IsChecked property is not binding Pin
Ashfaque Hussain15-Oct-15 1:56
Ashfaque Hussain15-Oct-15 1:56 
GeneralRe: Checkbox IsChecked property is not binding Pin
Meshack Musundi15-Oct-15 3:10
professionalMeshack Musundi15-Oct-15 3:10 
QuestionWPF Binding Issue Pin
Saurabh18cs12-Oct-15 17:55
Saurabh18cs12-Oct-15 17:55 
Hello Everyone,

I am facing issue in binding data to my controls. I am not able to implement below 2 scenarios:

1) whenever i am updating my textbox text my view model is not listening the change.
2) i also want to update my other 2 textbox text property based on the value of first textbox.

Kindly help me on this one.

here is my View

<Window x:Class="iPLAN20.Windows.LS.frmLinkApplicationSite"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlnsBig Grin | :-D ="http://schemas.microsoft.com/expression/blend/2008"
xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
xmlns:local="clr-namespace:iPLAN20.Model.LS"
xmlns:stb="clr-namespace:UIControls;assembly=iPLAN20UIControls"
Title="Link Information" Height="260" Width="320" Loaded="Window_Loaded" ResizeMode="NoResize" WindowStartupLocation="CenterScreen">
<Window.Resources>
<local:clsAppSiteLinkModel x:Key="AppSiteModel"/>
</Window.Resources>
<Grid HorizontalAlignment="Left" Name="gridLandSafeguardingLink" DataContext="{StaticResource AppSiteModel}">
<Grid.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="..\..\Resources\ButtonStyle.xaml"/>
<ResourceDictionary Source="..\..\Resources\textbox.xaml"/>
<ResourceDictionary Source="..\..\Resources\Common.xaml"/>
<ResourceDictionary Source="..\..\Resources\ComboBox.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Grid.Resources>

<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
</Grid.RowDefinitions>

<Label Content="Site No.:" HorizontalAlignment="Left" VerticalAlignment="Center" Style="{StaticResource ASCIILabelStyle}" Grid.Row="0" Grid.Column="0"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center" Grid.Row="0" Grid.Column="1">
<TextBox Text="{Binding Path=AppSiteList, UpdateSourceTrigger=PropertyChanged, Mode=OneWayToSource}" stb:AutoCompleteBehavior.AutoCompleteItemsSource="{Binding AppSiteList}" AutoWordSelection="True" Width="190" Name="txtSearchAppSite" TextAlignment="Center" Margin="10,4,4,4" VerticalContentAlignment="Center" Grid.Column="1"/>
<Button IsDefault="True" x:Name="btnFind" Style="{StaticResource MetroButton}" Margin="1" Width="30" Height="30">
<Button.Content>
<StackPanel Orientation="Horizontal">
<Image Source="/IPLAN20;component/Images/Search.png" Width="12"/>
</StackPanel>
</Button.Content>
</Button>
</StackPanel>
<Label Grid.Row="1" Grid.Column="0" Style="{StaticResource ASCIILabelStyle}" Content="Choose Site:" HorizontalAlignment="Left" VerticalAlignment="Center"/>
<ComboBox Grid.Row="1" Grid.Column="1" Style="{StaticResource ComboBoxStyle}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="10,4,4,4" Width="220" ItemsSource="{Binding LinkOID}"></ComboBox>

<Label Grid.Row="2" Grid.Column="0" Style="{StaticResource ASCIILabelStyle}" Content="Status:" HorizontalAlignment="Left" VerticalAlignment="Center"/>
<TextBox x:Name="txtStatus" Width="220" Grid.Row="2" Grid.Column="1" Style="{StaticResource TextBoxStyle}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="10,4,4,4" Text="{Binding AppSiteListColl[0].AppSiteStatus}"/>
<Label Grid.Row="3" Grid.Column="0" Style="{StaticResource ASCIILabelStyle}" Content="Description:" HorizontalAlignment="Left" VerticalAlignment="Center"/>
<TextBox x:Name="txtDescription" Height="100" Grid.Row="3" Grid.Column="1" Style="{StaticResource TextBoxStyle}" TextWrapping="Wrap" AcceptsReturn="True" VerticalScrollBarVisibility="Auto" Margin="10,4,4,4" Text="{Binding AppSiteListColl[0].AppSiteDescription}" />

<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Row="4" Grid.Column="1">
<Button Content="Link" IsDefault="True" x:Name="btnLink" Style="{StaticResource MetroButton}"/>
<Button Content="Close" IsDefault="False" x:Name="btnCancel" Style="{StaticResource MetroButton}"/>
</StackPanel>

<!--<WindowsFormsHost>
<wf:ListBox x:Name="lstBox"/>
</WindowsFormsHost>-->

</Grid>
</Window>

and my view model

class clsAppSiteLinkModel:INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;

clsLandSafeguarding objLandSafeguarding = new clsLandSafeguarding();

private ObservableCollection<string> _collAppSiteListForLink = new ObservableCollection<string>();
private ObservableCollection<clsSearchAppSiteLink> objObCollAppSiteForLink = null;
public ObservableCollection<string> AppSiteList
{
get { return _collAppSiteListForLink; }
set
{
_collAppSiteListForLink = value;
FirePropertyChanged("AppSiteList");
}
}
public ObservableCollection<clsSearchAppSiteLink> AppSiteListColl
{
get { return objObCollAppSiteForLink; }
}

private ObservableCollection<string> _collOID = new ObservableCollection<string>();
ObservableCollection<clsObjectId> objObCollOID = null;
public ObservableCollection<string> LinkOID
{
get { return _collOID; }
}

public clsAppSiteLinkModel()
{
if (iPLANConstants.Instance.Workspace == null)
{ return; }

objObCollAppSiteForLink = objLandSafeguarding.GetAppSiteForLink();

//Selecting Application site No's from MV_IPLAN_EPACS
if (objObCollAppSiteForLink != null)
{
foreach (clsSearchAppSiteLink appSiteNo in objObCollAppSiteForLink)
{
this.AppSiteList.Add(appSiteNo.AppSiteNo);
}
}

objObCollOID = objLandSafeguarding.GetNewSiteOID();
//Selecting feature OID's from file geodatabase
if (objObCollOID != null)
{
foreach (clsObjectId objctID in objObCollOID)
{
this.LinkOID.Add(objctID.ObjectIds);
}
}
}

private void FirePropertyChanged(string propertyName)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
}


whenever txtSearchAppSite text gets changed based on the value txtStatus and txtDescription changed their values. All data is there under objObCollAppSiteForLink observable collection and loaded(Working fine)

Thanks and Regards

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.