xaml - Why is my DependencyProperty not accessible? -


i have user control called alarmsettings, user control's resource dictionary contains instance of custom class "alarmclock", alarmclock has dependency property called alarmname, why error error "the member "alarmname" not recognized or not accessible."

this user control:

<usercontrol x:class="changeset.alarmsettings" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:toolkit="clr-namespace:microsoft.phone.controls;assembly=microsoft.phone.controls.toolkit" xmlns:alarm="clr-namespace:changeset.alarm;assembly=changeset" mc:ignorable="d" fontfamily="{staticresource phonefontfamilynormal}" fontsize="{staticresource phonefontsizenormal}" foreground="{staticresource phoneforegroundbrush}" d:designheight="480" d:designwidth="480" >  <usercontrol.resources>          <alarm:alarmclock x:key="alarmclock" alarmname="{binding elementname=alarmsettings, path=name}"/> </usercontrol.resources> 

this alarmclock class:

public class alarmclock: dependencyobject {      public alarmclock()     {         populatesettingsoptions();     }      public string alarmname      {         { return getvalue(alarmnameproperty).tostring(); }         set { setvalue(alarmnameproperty, value); }     }      public static readonly dependencyproperty alarmnameproperty =         dependencyproperty.register("alarmname", typeof(string), typeof(alarmclock), new propertymetadata("defaultalarm")); 

note: i'm trying bind alarmname name property of alarmsettings user control if remove binding , try set alarmname dependency property string still same error.

i had moved project 1 location , got same issue dependency property when opened again. rebuild , errors got resolved.


Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -