Click here to Skip to main content
15,884,425 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: MVVM:How to bind the MenuItem Command of ListBoxItem ContextMenu dynamically? Pin
Member 137073829-Dec-12 17:00
Member 137073829-Dec-12 17:00 
GeneralRe: MVVM:How to bind the MenuItem Command of ListBoxItem ContextMenu dynamically? Pin
SledgeHammer0129-Dec-12 17:25
SledgeHammer0129-Dec-12 17:25 
GeneralRe: MVVM:How to bind the MenuItem Command of ListBoxItem ContextMenu dynamically? Pin
Member 137073829-Dec-12 19:02
Member 137073829-Dec-12 19:02 
Questionmm Pin
Aishwarya aishu28-Dec-12 0:44
Aishwarya aishu28-Dec-12 0:44 
AnswerRe: mm Pin
Richard MacCutchan28-Dec-12 5:59
mveRichard MacCutchan28-Dec-12 5:59 
Generalsiverlight Pin
Aishwarya aishu28-Dec-12 0:42
Aishwarya aishu28-Dec-12 0:42 
GeneralRe: siverlight Pin
Richard MacCutchan28-Dec-12 5:57
mveRichard MacCutchan28-Dec-12 5:57 
QuestionDataTrigger bind to a Property Pin
mbv80023-Dec-12 17:01
mbv80023-Dec-12 17:01 
I am trying to change the appearance of a control when the value of a property changes. I am using the XAML and C# code below, but nothing happens when I click on the button that changes the value of the Property myProperty, except when I first run the application. Any suggestions?


XML
<Window x:Class="WpfApplication3.MainWindow"
        
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525">
    
<Grid>
<Button Height="34" HorizontalAlignment="Left" x:Name="toggleBroadcast" VerticalAlignment="Top" Width="133" Margin="180,0,0,0">
<Button.Style>
  <Style x:Name="bb" TargetType="{x:Type Button}">
   <Setter Property="Content" Value="Original Content"/>
    <Style.Triggers>
      <DataTrigger Binding="{Binding Path=myProperty}" Value="true">
        <Setter Property="Content" Value="IS TRUE"/>
      </DataTrigger>
      <DataTrigger Binding="{Binding Path=myProperty}" Value="false">
          <Setter Property="Content" Value="IS FALSE"/>
      </DataTrigger>
     </Style.Triggers>
                    
                </Style>
            </Button.Style>
         </Button>
        <Button Content="Click on This Button" HorizontalAlignment="Left" Width="158" Click="Button_Click_1" Height="34" VerticalAlignment="Top"/>
   </Grid>
</Window>



C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace WpfApplication3
{
    public partial class MainWindow : Window
    {
        Boolean _Check = false;
        public MainWindow()
        {
            DataContext = this;
            InitializeComponent();
        }
        public Boolean check
        {
            get
            {
                return _Check;
            }
        }

        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            _Check = !_Check;
        }
    }
}

AnswerRe: DataTrigger bind to a Property Pin
Pete O'Hanlon23-Dec-12 19:17
mvePete O'Hanlon23-Dec-12 19:17 
AnswerRe: DataTrigger bind to a Property Pin
Wayne Gaylard23-Dec-12 19:39
professionalWayne Gaylard23-Dec-12 19:39 
QuestionWPF Adorner Issues Pin
#realJSOP17-Dec-12 10:52
mve#realJSOP17-Dec-12 10:52 
AnswerRe: WPF Adorner Issues Pin
SledgeHammer0118-Dec-12 4:49
SledgeHammer0118-Dec-12 4:49 
GeneralRe: WPF Adorner Issues Pin
#realJSOP20-Dec-12 9:09
mve#realJSOP20-Dec-12 9:09 
GeneralRe: WPF Adorner Issues Pin
SledgeHammer0121-Dec-12 4:50
SledgeHammer0121-Dec-12 4:50 
QuestionSilverlight Dynamic indexed binding Pin
Member 934221816-Dec-12 18:02
Member 934221816-Dec-12 18:02 
QuestionThird Party Controls Pin
Kevin Marois11-Dec-12 7:22
professionalKevin Marois11-Dec-12 7:22 
AnswerRe: Third Party Controls Pin
Mycroft Holmes11-Dec-12 12:06
professionalMycroft Holmes11-Dec-12 12:06 
AnswerRe: Third Party Controls Pin
Pete O'Hanlon11-Dec-12 12:43
mvePete O'Hanlon11-Dec-12 12:43 
GeneralRe: Third Party Controls Pin
Kevin Marois12-Dec-12 8:28
professionalKevin Marois12-Dec-12 8:28 
GeneralRe: Third Party Controls Pin
Pete O'Hanlon12-Dec-12 8:29
mvePete O'Hanlon12-Dec-12 8:29 
GeneralRe: Third Party Controls Pin
Kevin Marois12-Dec-12 8:30
professionalKevin Marois12-Dec-12 8:30 
GeneralRe: Third Party Controls Pin
Mycroft Holmes12-Dec-12 12:02
professionalMycroft Holmes12-Dec-12 12:02 
QuestionHow can I Bind a DataTemplate Slider definition to the Code behind? Pin
maycockt10-Dec-12 5:24
maycockt10-Dec-12 5:24 
AnswerRe: How can I Bind a DataTemplate Slider definition to the Code behind? Pin
Alisaunder10-Dec-12 13:52
Alisaunder10-Dec-12 13:52 
GeneralRe: How can I Bind a DataTemplate Slider definition to the Code behind? Pin
maycockt14-Dec-12 1:18
maycockt14-Dec-12 1:18 

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.