Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / Tools / System.Activities.Core.Presentation / System / Activities / Core / Presentation / IfElseDesigner.xaml.cs / 1305376 / IfElseDesigner.xaml.cs
//---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.Activities.Core.Presentation { using System; using System.Activities.Presentation.Metadata; using System.Activities.Presentation.View; using System.Activities.Presentation.Converters; using System.Activities.Statements; using System.ComponentModel; using System.Diagnostics; using System.Runtime; using System.Windows; using System.Windows.Data; ////// Interaction logic for IfElseDesigner.xaml /// partial class IfElseDesigner { public IfElseDesigner() { InitializeComponent(); } public static void RegisterMetadata(AttributeTableBuilder builder) { Type type = typeof(If); builder.AddCustomAttributes(type, new DesignerAttribute(typeof(IfElseDesigner))); builder.AddCustomAttributes(type, type.GetProperty("Then"), BrowsableAttribute.No); builder.AddCustomAttributes(type, type.GetProperty("Else"), BrowsableAttribute.No); } void OnExpressionEditorLoaded(object sender, RoutedEventArgs e) { ExpressionTextBox expressionTextBox = sender as ExpressionTextBox; Fx.Assert(expressionTextBox != null, "sender should be userControl"); //bind ExpressionProperty of Expression textbox to ModelItem.Condition Binding b = new Binding(); ArgumentToExpressionConverter argumentToExpressionConverter = new ArgumentToExpressionConverter(); b.Converter = argumentToExpressionConverter; b.Mode = BindingMode.TwoWay; b.Source = this.ModelItem; b.Path = new PropertyPath("Condition"); if (BindingOperations.GetBinding(expressionTextBox, ExpressionTextBox.ExpressionProperty) != null) { BindingOperations.ClearBinding(expressionTextBox, ExpressionTextBox.ExpressionProperty); } expressionTextBox.SetBinding(ExpressionTextBox.ExpressionProperty, b); //bind OwnerActivityProperty of Expression textbox to ModelItem Binding b1 = new Binding(); b1.Source = this.ModelItem; if (BindingOperations.GetBinding(expressionTextBox, ExpressionTextBox.OwnerActivityProperty) != null) { BindingOperations.ClearBinding(expressionTextBox, ExpressionTextBox.OwnerActivityProperty); } expressionTextBox.SetBinding(ExpressionTextBox.OwnerActivityProperty, b1); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TypeInitializationException.cs
- TableLayoutSettingsTypeConverter.cs
- JpegBitmapDecoder.cs
- TokenBasedSet.cs
- AssemblyAttributesGoHere.cs
- EdmToObjectNamespaceMap.cs
- CodeIdentifier.cs
- CodeGroup.cs
- SoapSchemaExporter.cs
- ControlUtil.cs
- SearchForVirtualItemEventArgs.cs
- ConfigUtil.cs
- xml.cs
- HtmlEmptyTagControlBuilder.cs
- RuntimeResourceSet.cs
- PolyLineSegmentFigureLogic.cs
- Component.cs
- XmlMtomReader.cs
- SafeRegistryKey.cs
- ResourceDictionaryCollection.cs
- ToolStripItem.cs
- UriParserTemplates.cs
- ReversePositionQuery.cs
- Quaternion.cs
- WindowsAltTab.cs
- DecoderBestFitFallback.cs
- BoolExpression.cs
- ReaderWriterLock.cs
- UnsafeNativeMethodsTablet.cs
- PointAnimationUsingPath.cs
- StickyNoteContentControl.cs
- AutoResetEvent.cs
- NameGenerator.cs
- AppDomainAttributes.cs
- SafeBitVector32.cs
- SecurityNegotiationException.cs
- WebResourceAttribute.cs
- BaseTreeIterator.cs
- IgnoreFlushAndCloseStream.cs
- FixedDocumentSequencePaginator.cs
- Catch.cs
- SecurityPolicySection.cs
- SqlTypeSystemProvider.cs
- DateTime.cs
- SelectionItemProviderWrapper.cs
- NumberFormatter.cs
- ParallelActivityDesigner.cs
- XmlAttributeOverrides.cs
- XmlBufferedByteStreamReader.cs
- ProxyHwnd.cs
- ImageBrush.cs
- CqlBlock.cs
- ProcessModuleDesigner.cs
- ValueType.cs
- Visual.cs
- MergeFilterQuery.cs
- _NestedMultipleAsyncResult.cs
- TextRunCache.cs
- RangeEnumerable.cs
- BindUriHelper.cs
- DocumentPageHost.cs
- Profiler.cs
- Window.cs
- ZoneLinkButton.cs
- SqlFileStream.cs
- ApplicationSecurityInfo.cs
- AdRotator.cs
- ApplicationFileCodeDomTreeGenerator.cs
- VirtualPathData.cs
- TraceXPathNavigator.cs
- WinCategoryAttribute.cs
- SequentialUshortCollection.cs
- GPPOINTF.cs
- documentsequencetextview.cs
- HttpRequest.cs
- UInt16.cs
- DefaultSection.cs
- ImageMapEventArgs.cs
- StylusPointProperties.cs
- RunClient.cs
- XmlCompatibilityReader.cs
- DataSvcMapFile.cs
- JournalEntryStack.cs
- DefaultValueTypeConverter.cs
- safemediahandle.cs
- Literal.cs
- DeferredElementTreeState.cs
- KeyProperty.cs
- ColorConvertedBitmap.cs
- StringValidator.cs
- UnsafeNativeMethods.cs
- SafeSecurityHandles.cs
- LogReserveAndAppendState.cs
- EpmSourceTree.cs
- Pen.cs
- Activity.cs
- Win32SafeHandles.cs
- ProxyManager.cs
- ResXResourceSet.cs
- OraclePermissionAttribute.cs