Click here to Skip to main content
15,886,095 members
Home / Discussions / C#
   

C#

 
GeneralRe: Speech recognition and drawing Pin
Albert Holguin17-Jan-12 11:24
professionalAlbert Holguin17-Jan-12 11:24 
AnswerRe: Speech recognition and drawing Pin
Luc Pattyn17-Jan-12 11:57
sitebuilderLuc Pattyn17-Jan-12 11:57 
AnswerRe: Speech recognition and drawing Pin
venomation18-Jan-12 2:30
venomation18-Jan-12 2:30 
QuestionModal Form in WeifenLuo.WinFormsUI.Docking Pin
Member 150645617-Jan-12 4:47
Member 150645617-Jan-12 4:47 
AnswerRe: Modal Form in WeifenLuo.WinFormsUI.Docking Pin
Pete O'Hanlon17-Jan-12 5:00
mvePete O'Hanlon17-Jan-12 5:00 
Questionunable to bind to TextBox.Text Pin
Giorgi Nistor16-Jan-12 23:16
Giorgi Nistor16-Jan-12 23:16 
AnswerRe: unable to bind to TextBox.Text Pin
BobJanova16-Jan-12 23:21
BobJanova16-Jan-12 23:21 
GeneralRe: unable to bind to TextBox.Text Pin
Giorgi Nistor16-Jan-12 23:33
Giorgi Nistor16-Jan-12 23:33 
ok, I have changed the set property but I don't understand the second part.
I should not use this mObj object directly in XAML?


C#
public string pText
        {
            get { return text; }
            set 
            { 
                text = value;
                OnPropertyChanged("pText");
            }
        }


mObj is declared in Window.Resources
HTML
<Window.Resources>
     <c:CMyData x:Key="mObj" pText="George"/>
 </Window.Resources>


I have changed the Xaml stil it is not working

HTML
<Window x:Class="binding5.MainWindow"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:local="clr-namespace:binding5"
  Title="MainWindow" Height="350" Width="525">
    
    
    <DockPanel Name="dockPanel1">
        <DockPanel.Resources>
            <local:CMyData x:Key="mObj" pText="George"/>
        </DockPanel.Resources>
        
        <Border BorderBrush="Silver" BorderThickness="1" Name="border1" DockPanel.Dock="Top" HorizontalAlignment="Stretch" VerticalAlignment="Top" Height="50">
            <Button Content="Button" Name="button1" Height="47" Click="button1_Click" />
        </Border>
        <Border BorderBrush="Silver" BorderThickness="1" Name="border2">
            <TextBox>
                <TextBox.Text>
                    <Binding Source="{StaticResource mObj}" Path="pText" UpdateSourceTrigger="PropertyChanged" Mode="TwoWay" />
                </TextBox.Text>
            </TextBox>    
        </Border>
    </DockPanel>
</Window>


modified 17-Jan-12 5:59am.

GeneralRe: unable to bind to TextBox.Text Pin
BobJanova17-Jan-12 1:47
BobJanova17-Jan-12 1:47 
GeneralRe: unable to bind to TextBox.Text Pin
Giorgi Nistor17-Jan-12 2:05
Giorgi Nistor17-Jan-12 2:05 
AnswerRe: unable to bind to TextBox.Text Pin
Pete O'Hanlon17-Jan-12 2:31
mvePete O'Hanlon17-Jan-12 2:31 
GeneralRe: unable to bind to TextBox.Text Pin
Giorgi Nistor17-Jan-12 4:17
Giorgi Nistor17-Jan-12 4:17 
GeneralRe: unable to bind to TextBox.Text Pin
Pete O'Hanlon17-Jan-12 4:31
mvePete O'Hanlon17-Jan-12 4:31 
Questionbeginer in c# Pin
Member 857363216-Jan-12 23:05
Member 857363216-Jan-12 23:05 
AnswerRe: beginer in c# Pin
V.16-Jan-12 23:08
professionalV.16-Jan-12 23:08 
AnswerRe: beginer in c# Pin
Richard MacCutchan16-Jan-12 23:10
mveRichard MacCutchan16-Jan-12 23:10 
AnswerRe: beginer in c# Pin
thatraja16-Jan-12 23:11
professionalthatraja16-Jan-12 23:11 
QuestionHow To Track [ Inserted/Updated ] Records Using ADO.NET Pin
AmbiguousName16-Jan-12 21:17
AmbiguousName16-Jan-12 21:17 
AnswerRe: How To Track [ Inserted/Updated ] Records Using ADO.NET Pin
Mycroft Holmes16-Jan-12 21:54
professionalMycroft Holmes16-Jan-12 21:54 
AnswerRe: How To Track [ Inserted/Updated ] Records Using ADO.NET Pin
BobJanova16-Jan-12 22:42
BobJanova16-Jan-12 22:42 
QuestionC# Limit number of characters user can enter - Console Application Pin
Deborah Palmer McCain16-Jan-12 12:08
Deborah Palmer McCain16-Jan-12 12:08 
AnswerRe: C# Limit number of characters user can enter - Console Application Pin
Wayne Gaylard16-Jan-12 18:46
professionalWayne Gaylard16-Jan-12 18:46 
GeneralRe: C# Limit number of characters user can enter - Console Application Pin
Deborah Palmer McCain16-Jan-12 19:04
Deborah Palmer McCain16-Jan-12 19:04 
GeneralRe: C# Limit number of characters user can enter - Console Application Pin
Wayne Gaylard16-Jan-12 19:14
professionalWayne Gaylard16-Jan-12 19:14 
AnswerRe: C# Limit number of characters user can enter - Console Application Pin
BobJanova16-Jan-12 22:39
BobJanova16-Jan-12 22:39 

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.