当前位置: 首页>>代码示例>>C#>>正文


C# ContentDialog.SetBinding方法代码示例

本文整理汇总了C#中ContentDialog.SetBinding方法的典型用法代码示例。如果您正苦于以下问题:C# ContentDialog.SetBinding方法的具体用法?C# ContentDialog.SetBinding怎么用?C# ContentDialog.SetBinding使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ContentDialog的用法示例。


在下文中一共展示了ContentDialog.SetBinding方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DoSignInInUIThread

        private async Task<Credential> DoSignInInUIThread(CredentialRequestInfo credentialRequestInfo)
        {
            var signInDialog = this;

            // Create the ContentDialog that contains the SignInDialog
            var contentDialog = new ContentDialog
            {
                SecondaryButtonText = "cancel",
                PrimaryButtonText = "sign in",
                FullSizeDesired = true,
                Content = signInDialog,
            };

            contentDialog.PrimaryButtonClick += ContentDialogOnPrimaryButtonClick;

            // Bind the Title so the ContentDialog Title is the SignInDialog title (that will be initialized later)
            contentDialog.SetBinding(ContentDialog.TitleProperty, new Binding { Path = new PropertyPath("Title"), Source = signInDialog });

            contentDialog.SetBinding(ContentDialog.IsPrimaryButtonEnabledProperty, new Binding { Path = new PropertyPath("IsReady"), Source = signInDialog });

            contentDialog.Closed += ContentDialogOnClosed; // be sure the SignInDialog is deactivated when pressing back button

            // Show the content dialog
            var _ = contentDialog.ShowAsync(); // don't await else that would block here

            // Wait for the creation of the credential
            Credential crd;
            try
            {
                crd = await signInDialog.WaitForCredentialAsync(credentialRequestInfo);
            }
            finally
            {
                // Close the content dialog
                contentDialog.Hide();
            }

            return crd;
        }
开发者ID:skudev,项目名称:arcgis-toolkit-dotnet,代码行数:39,代码来源:SignInDialog.cs

示例2: CopyBindings

 private void CopyBindings(ContentDialog dialog, DependencyProperty property, string path)
 {
     Contract.Requires(dialog != null, nameof(dialog));
     Contract.Requires(property != null, nameof(property));
     dialog.SetBinding(property, new Binding
     {
         Source = this,
         Path = new PropertyPath(path)
     });
 }
开发者ID:TorreyGarland,项目名称:Highway1.Universal,代码行数:10,代码来源:ContentDialogAction.cs


注:本文中的ContentDialog.SetBinding方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。