Click here to Skip to main content
15,887,083 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: MVVM newbie question - this doesn't seem to work with databinding Pin
Ian Shlasko9-Dec-09 8:14
Ian Shlasko9-Dec-09 8:14 
GeneralRe: MVVM newbie question - this doesn't seem to work with databinding Pin
Judah Gabriel Himango9-Dec-09 11:02
sponsorJudah Gabriel Himango9-Dec-09 11:02 
GeneralRe: MVVM newbie question - this doesn't seem to work with databinding Pin
Ian Shlasko9-Dec-09 11:31
Ian Shlasko9-Dec-09 11:31 
GeneralRe: MVVM newbie question - this doesn't seem to work with databinding Pin
Judah Gabriel Himango9-Dec-09 11:34
sponsorJudah Gabriel Himango9-Dec-09 11:34 
GeneralRe: MVVM newbie question - this doesn't seem to work with databinding Pin
Ian Shlasko9-Dec-09 13:08
Ian Shlasko9-Dec-09 13:08 
AnswerRe: MVVM newbie question - this doesn't seem to work with databinding Pin
Pete O'Hanlon9-Dec-09 10:11
mvePete O'Hanlon9-Dec-09 10:11 
GeneralRe: MVVM newbie question - this doesn't seem to work with databinding [modified] Pin
Judah Gabriel Himango9-Dec-09 10:59
sponsorJudah Gabriel Himango9-Dec-09 10:59 
QuestionDependancy Property not setting on user control Pin
rj_hogan9-Dec-09 4:01
rj_hogan9-Dec-09 4:01 
Hello,

Fairly new to WPF so hope this isn't going to be a case of failing to RTFM but I just can't see what has gone wrong.

I am modifying an existing user control to show slightly different data in a list depending on a setting on the control. I have registered the dependency property, added a get;set to use it else where in code and it comes up in the Intellisense in the XAML file. However it is not set to the value I've set it to in the XAML when it is check in the controls constructor.

Here is the relevant bits of the user control:

public partial class StationGroupControl : UserControl
    {
       
        public StationGroupControl()
        {

            try
            {

                if (ShowAggregates != true)
...

        public static DependencyProperty ShowAggregatesProperty =
            DependencyProperty.Register("ShowAggregates",
            typeof(Boolean),
            typeof(StationGroupControl),
            new FrameworkPropertyMetadata(false));

        public Boolean ShowAggregates
        {
            get
            {
                return (Boolean)GetValue(ShowAggregatesProperty);
            }
            set
            {
                SetValue(ShowAggregatesProperty, value);
            }
        }



And the XAML:

<ResearchCtrl:StationGroupControl Name="MultStation" HorizontalAlignment="Left" Margin="-122,0,0,0" Validation.Error="Ctrl_Error" ShowAggregates="True"></ResearchCtrl:StationGroupControl>


Frustratingly this seemed to be working and I then refactored the code down to smaller chunks and it inexplicably stoppped working. It has me doubting if it was ever working properly.

Is there some issue with using a boolean? Something else I need to do? Any way of debugging what is actually happening?

I'm pushed for time on this so any suggestion gratefully received.

Robert.
AnswerRe: Dependancy Property not setting on user control Pin
Ian Shlasko9-Dec-09 4:31
Ian Shlasko9-Dec-09 4:31 
GeneralRe: Dependancy Property not setting on user control Pin
rj_hogan9-Dec-09 4:46
rj_hogan9-Dec-09 4:46 
GeneralRe: Dependancy Property not setting on user control Pin
rj_hogan9-Dec-09 6:45
rj_hogan9-Dec-09 6:45 
GeneralRe: Dependancy Property not setting on user control Pin
Mark Salsbery9-Dec-09 6:53
Mark Salsbery9-Dec-09 6:53 
QuestionFreeze first item in listbox from scrolling. Pin
Member 23244838-Dec-09 10:28
Member 23244838-Dec-09 10:28 
QuestionDynamicResource not working, but StaticResource does ??? Pin
assassin3168-Dec-09 3:18
assassin3168-Dec-09 3:18 
QuestionSession variables in Silverlight or wcf service Pin
Nekkantidivya7-Dec-09 18:43
Nekkantidivya7-Dec-09 18:43 
AnswerRe: Session variables in Silverlight or wcf service Pin
Abhinav S10-Dec-09 6:37
Abhinav S10-Dec-09 6:37 
QuestionApplication menu button issue Pin
trey white7-Dec-09 8:40
trey white7-Dec-09 8:40 
QuestionWPF Ribbon bar issue Pin
trey white7-Dec-09 8:35
trey white7-Dec-09 8:35 
AnswerRe: WPF Ribbon bar issue Pin
trey white7-Dec-09 11:09
trey white7-Dec-09 11:09 
QuestionError in RoutedEventHandler() Pin
Anu_Bala7-Dec-09 0:04
Anu_Bala7-Dec-09 0:04 
QuestionUsing WPF Browser application in website. Pin
Hema Bairavan6-Dec-09 18:02
Hema Bairavan6-Dec-09 18:02 
QuestionSimple templated grid row. Pin
Dunge6-Dec-09 9:21
Dunge6-Dec-09 9:21 
QuestionScaleTransform sometimes produces glaring artifacts [modified] Pin
fjparisIII5-Dec-09 13:47
fjparisIII5-Dec-09 13:47 
AnswerRe: ScaleTransform sometimes produces glaring artifacts [modified] Pin
Insincere Dave6-Dec-09 13:55
Insincere Dave6-Dec-09 13:55 
GeneralRe: ScaleTransform sometimes produces glaring artifacts Pin
fjparisIII6-Dec-09 14:35
fjparisIII6-Dec-09 14:35 

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.