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
- MenuRendererStandards.cs
- TabControl.cs
- TcpDuplicateContext.cs
- DSACryptoServiceProvider.cs
- Normalization.cs
- EventProviderWriter.cs
- WebBrowsableAttribute.cs
- LogicalCallContext.cs
- SymbolPair.cs
- SqlBuilder.cs
- RIPEMD160Managed.cs
- DocumentXmlWriter.cs
- ToolboxComponentsCreatedEventArgs.cs
- WarningException.cs
- StdRegProviderWrapper.cs
- SafeBitVector32.cs
- ReadWriteSpinLock.cs
- FileAuthorizationModule.cs
- SqlExpander.cs
- CannotUnloadAppDomainException.cs
- JsonUriDataContract.cs
- ElementNotAvailableException.cs
- UdpUtility.cs
- formatter.cs
- FormatConvertedBitmap.cs
- CheckBoxList.cs
- AudioFormatConverter.cs
- PageVisual.cs
- HttpGetClientProtocol.cs
- DiscoveryDocumentLinksPattern.cs
- DynamicActionMessageFilter.cs
- BinaryMethodMessage.cs
- SdlChannelSink.cs
- KeyedCollection.cs
- AccessControlList.cs
- ListCommandEventArgs.cs
- XmlNodeComparer.cs
- OdbcDataAdapter.cs
- DirtyTextRange.cs
- ContainerFilterService.cs
- TraceData.cs
- DataKey.cs
- CompressionTransform.cs
- TablePatternIdentifiers.cs
- ListControl.cs
- DataGridViewImageCell.cs
- XPathNodePointer.cs
- ControlEvent.cs
- MsdtcWrapper.cs
- TTSVoice.cs
- StateMachineHistory.cs
- InternalConfigEventArgs.cs
- OperationCanceledException.cs
- xml.cs
- HtmlInputFile.cs
- Rotation3DKeyFrameCollection.cs
- xdrvalidator.cs
- WorkflowOwnerAsyncResult.cs
- Calendar.cs
- XmlDataLoader.cs
- AutoResetEvent.cs
- SynchronousChannelMergeEnumerator.cs
- Maps.cs
- Operand.cs
- RectAnimation.cs
- TypeRefElement.cs
- ClonableStack.cs
- BasicHttpBinding.cs
- SQLInt16.cs
- PerfCounters.cs
- ImageMetadata.cs
- ImageResources.Designer.cs
- sortedlist.cs
- DocumentViewerAutomationPeer.cs
- WCFModelStrings.Designer.cs
- PeerEndPoint.cs
- BufferedOutputStream.cs
- InputProviderSite.cs
- ExpressionConverter.cs
- WorkflowTraceTransfer.cs
- File.cs
- ThicknessAnimation.cs
- TypeGeneratedEventArgs.cs
- InlineUIContainer.cs
- DataRowView.cs
- FormViewInsertedEventArgs.cs
- AssemblyUtil.cs
- ServicePointManager.cs
- ChannelParameterCollection.cs
- SchemaMerger.cs
- XmlTextReader.cs
- Route.cs
- ObjectDataSourceDisposingEventArgs.cs
- EntitySqlException.cs
- ProfileParameter.cs
- NetworkCredential.cs
- Events.cs
- Rotation3D.cs
- InputLanguageSource.cs
- SafeSecurityHandles.cs