This commit is contained in:
wieslawsoltes 2019-04-04 07:14:38 +00:00
Родитель cea9fe167d
Коммит 47b33a8c91
2 изменённых файлов: 10 добавлений и 10 удалений

Просмотреть файл

@ -7,7 +7,7 @@
<TextBox x:Name="textBoxSearchPath" Text="{Binding SearchPath}" IsEnabled="{Binding !IsWorking}" Margin="2" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"/>
<Button x:Name="buttonBrowse" Content="..." Margin="2" IsEnabled="{Binding !IsWorking}" Grid.Row="0" Grid.Column="2"/>
<TextBox x:Name="textBoxSearchPattern" Text="{Binding SearchPattern}" IsEnabled="{Binding !IsWorking}" Margin="2" Grid.Row="1" Grid.Column="0"/>
<DropDown x:Name="dropDownPatterns" Items="{Binding SearchPatterns}" SelectedItem="{Binding SearchPattern, Mode=OneWay}" IsEnabled="{Binding !IsWorking}" Margin="2" Grid.Row="1" Grid.Column="1"/>
<ComboBox x:Name="comboBoxPatterns" Items="{Binding SearchPatterns}" SelectedItem="{Binding SearchPattern, Mode=OneWay}" IsEnabled="{Binding !IsWorking}" Margin="2" Grid.Row="1" Grid.Column="1"/>
<Button x:Name="buttonSearch" Content="Search" Command="{Binding Search}" IsEnabled="{Binding !IsWorking}" Margin="2" Grid.Row="1" Grid.Column="2"/>
</Grid>
<Grid RowDefinitions="*,Auto" Margin="2" Grid.Row="1" Grid.Column="0">
@ -37,15 +37,15 @@
<Button x:Name="buttonConsolidate" Content="Consolidate" Command="{Binding ConsolidateVersions}" IsEnabled="{Binding !IsWorking}" Margin="2" Grid.Row="0" Grid.Column="1"/>
</Grid>
<Grid RowDefinitions="Auto" ColumnDefinitions="50*,100,50*,100" Grid.Row="2">
<DropDown x:Name="dropDownVersions" Items="{Binding Versions}" SelectedItem="{Binding CurrentVersion}" IsEnabled="{Binding !IsWorking}" Margin="2" Grid.Row="1" Grid.Column="0"/>
<ComboBox x:Name="comboBoxPVersions" Items="{Binding Versions}" SelectedItem="{Binding CurrentVersion}" IsEnabled="{Binding !IsWorking}" Margin="2" Grid.Row="1" Grid.Column="0"/>
<Button x:Name="buttonUseVersion" Content="Use Version" Command="{Binding UseVersion}" IsEnabled="{Binding !IsWorking}" Margin="2" Grid.Row="0" Grid.Column="1"/>
<DropDown x:Name="dropDownFeeds" Items="{Binding Feeds}" SelectedItem="{Binding CurrentFeed}" IsEnabled="{Binding !IsWorking}" Margin="2" Grid.Row="1" Grid.Column="2">
<DropDown.DataTemplates>
<ComboBox x:Name="comboBoxPFeeds" Items="{Binding Feeds}" SelectedItem="{Binding CurrentFeed}" IsEnabled="{Binding !IsWorking}" Margin="2" Grid.Row="1" Grid.Column="2">
<ComboBox.DataTemplates>
<DataTemplate>
<TextBlock Text="{Binding Name}" Margin="1"/>
</DataTemplate>
</DropDown.DataTemplates>
</DropDown>
</ComboBox.DataTemplates>
</ComboBox>
<Button x:Name="buttonVersions" Content="Get Versions" Command="{Binding GetVersions}" IsEnabled="{Binding !IsWorking}" Margin="2" Grid.Row="0" Grid.Column="3"/>
</Grid>
<CheckBox x:Name="checkBoxAlwaysUpdate" IsChecked="{Binding AlwaysUpdate}" Content="Always Update" IsEnabled="{Binding !IsWorking}" Margin="2" Grid.Row="3"/>

Просмотреть файл

@ -7,14 +7,14 @@ namespace PackageReferenceEditor.Avalonia.Views
{
public class MainView : UserControl
{
private readonly DropDown _dropDownPatterns;
private readonly ComboBox _comboBoxPatterns;
private readonly Button _buttonBrowse;
public MainView()
{
InitializeComponent();
_dropDownPatterns = this.FindControl<DropDown>("dropDownPatterns");
_dropDownPatterns.SelectionChanged += patterns_SelectionChanged;
_comboBoxPatterns = this.FindControl<ComboBox>("comboBoxPatterns");
_comboBoxPatterns.SelectionChanged += patterns_SelectionChanged;
_buttonBrowse = this.FindControl<Button>("buttonBrowse");
_buttonBrowse.Click += buttonBrowse_Click;
}
@ -30,7 +30,7 @@ namespace PackageReferenceEditor.Avalonia.Views
{
if (DataContext is ReferenceEditor vm)
{
vm.SearchPattern = _dropDownPatterns.SelectedItem as string;
vm.SearchPattern = _comboBoxPatterns.SelectedItem as string;
}
}
catch (Exception ex)