Example #1
0
        private void OnWrapOptionsAppBarButtonClick(object sender, RoutedEventArgs e)
        {
            var dialog = new WrapOptionsSelect()
            {
                TextWrapping = this.txtbox.TextWrapping
            };

            // Bind dialog to TextBox
            Binding binding = new Binding
            {
                Source = dialog,
                Path   = new PropertyPath("TextWrapping"),
                Mode   = BindingMode.TwoWay
            };

            txtbox.SetBinding(TextBox.TextWrappingProperty, binding);

            var popup = new Popup()
            {
                Child = dialog,
                IsLightDismissEnabled = true
            };

            popup.IsOpen = true;
        }
Example #2
0
        private void OnWrapOptionsAppBarButtonClick(object sender, RoutedEventArgs e)
        {
            var dialog = new WrapOptionsSelect()
            {
                TextWrapping = this.txtbox.TextWrapping
            };

            // Bind dialog to TextBox
            Binding binding = new Binding
            {
                Source = dialog,
                Path = new PropertyPath("TextWrapping"),
                Mode = BindingMode.TwoWay
            };

            txtbox.SetBinding(TextBox.TextWrappingProperty, binding);

            var popup = new Popup()
            {
                Child = dialog,
                IsLightDismissEnabled = true
            };

            popup.IsOpen = true;
        }