System.Xaml.Schema.XamlMemberInvoker.SetValue C# (CSharp) Method

SetValue() public method

public SetValue ( object instance, object value ) : void
instance object
value object
return void
		public virtual void SetValue (object instance, object value)
		{
			ThrowIfUnknown ();
			if (instance == null)
				throw new ArgumentNullException ("instance");
			if (member is XamlDirective)
				throw new NotSupportedException (String.Format ("not supported operation on directive member {0}", member));
			if (UnderlyingSetter == null)
				throw new NotSupportedException (String.Format ("Attempt to set value from read-only property {0}", member));
			UnderlyingSetter.Invoke (instance, new object [] {value});
		}

Usage Example

Example #1
0
		public void SetValueOnReadOnlyProperty ()
		{
			var pi = str_len;
			var i = new XamlMemberInvoker (new XamlMember (pi, sctx));
			i.SetValue ("hello", 5);
		}
All Usage Examples Of System.Xaml.Schema.XamlMemberInvoker::SetValue