Skip to content

Commit

Permalink
Merge pull request dotnet#17 from cmeeren/codelens-binding
Browse files Browse the repository at this point in the history
Bind only from XAML
  • Loading branch information
realvictorprm committed Oct 25, 2017
2 parents 9b97e24 + 3259308 commit afc2622
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
6 changes: 1 addition & 5 deletions vsintegration/src/FSharp.Editor/Options/EditorOptions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,4 @@ module internal OptionsUI =
type internal CodeLensOptionPage() =
inherit AbstractOptionPage<CodeLensOptions>()
override this.CreateView() =
let view = CodeLensOptionControl()
bindCheckBox view.replaceWithLineLens "ReplaceWithLineLens"
bindCheckBox view.enableCodeLens "Enabled"
bindTextBox view.prefix "Prefix"
upcast view
upcast CodeLensOptionControl()
3 changes: 0 additions & 3 deletions vsintegration/src/FSharp.Editor/Options/UIHelpers.fs
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ module internal OptionsUIHelpers =
let bindCheckBox (checkBox: CheckBox) (path: string) =
checkBox.SetBinding(CheckBox.IsCheckedProperty, path) |> ignore

let bindTextBox (textBox: TextBox) (path: string) =
textBox.SetBinding(TextBox.TextProperty, path) |> ignore

// some helpers to create option views in code instead of XAML
let ( *** ) (control : #IAddChild) (children: UIElement list) =
children |> List.iter control.AddChild
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<StackPanel>
<GroupBox Header="{x:Static local:Strings.CodeLens}">
<StackPanel>
<CheckBox x:Name="enableCodeLens" IsChecked="{Binding CodeLensSwitch}"
<CheckBox x:Name="enableCodeLens" IsChecked="{Binding Enabled}"
Content="{x:Static local:Strings.CodeLens_Switch}"/>
<CheckBox x:Name="replaceWithLineLens" IsChecked="{Binding ReplaceWithLineLens}"
Content="{x:Static local:Strings.CodeLens_Replace_LineLens}"/>
Expand All @@ -30,12 +30,9 @@
</Grid.ColumnDefinitions>
<Label Grid.Column="0" Content="{x:Static local:Strings.CodeLens_Prefix}"/>
<TextBox x:Name="prefix" Grid.Column="1"
Text="{Binding Prefix, UpdateSourceTrigger=PropertyChanged}"
HorizontalContentAlignment="Right"
VerticalContentAlignment="Center" Margin="7,0,-116,0">
<TextBox.Text>
<Binding UpdateSourceTrigger="PropertyChanged" Path="Prefix">
</Binding>
</TextBox.Text>
</TextBox>
</Grid>
</StackPanel>
Expand Down

0 comments on commit afc2622

Please sign in to comment.