|
23 | 23 | <BitmapImage x:Key="RemoveIcon" UriSource="pack://application:,,,/Rubberduck.Resources;component/Icons/Fugue/arrow-180.png" />
|
24 | 24 |
|
25 | 25 | <local:ReferenceStatusImageSourceConverter x:Key="StatusToIcon" />
|
| 26 | + <local:PriorityButtonVisibilityConverter x:Key="PriorityButtonVisibility" /> |
26 | 27 | <converters:RemainingWidthConverter x:Key="RemainingWidth" />
|
27 | 28 |
|
28 | 29 | <Style x:Key="DialogButtonStyle" TargetType="Button">
|
|
135 | 136 | <Border BorderThickness="1" BorderBrush="{x:Static SystemColors.ControlLightBrush}" Margin="5">
|
136 | 137 | <Grid>
|
137 | 138 | <Grid.RowDefinitions>
|
138 |
| - <RowDefinition Height="Auto" /> |
139 | 139 | <RowDefinition Height="Auto" />
|
140 | 140 | <RowDefinition Height="*" />
|
141 | 141 | <RowDefinition Height="Auto" />
|
|
174 | 174 | </TabItem.Header>
|
175 | 175 | </TabItem>
|
176 | 176 | </TabControl>
|
177 |
| - <Border Grid.Row="1" |
178 |
| - Background="{x:Static SystemColors.ControlBrush}" |
179 |
| - BorderBrush="{x:Static SystemColors.ActiveBorderBrush}" |
180 |
| - BorderThickness="1" |
181 |
| - Margin="10,10,10,0" |
182 |
| - Padding="2"> |
183 |
| - <Grid> |
184 |
| - <Grid.ColumnDefinitions> |
185 |
| - <ColumnDefinition Width="*" /> |
186 |
| - <ColumnDefinition Width="20" /> |
187 |
| - <ColumnDefinition Width="20" /> |
188 |
| - </Grid.ColumnDefinitions> |
189 |
| - <TextBox Grid.Column="0"> |
190 |
| - <TextBox.Style> |
191 |
| - <Style TargetType="{x:Type TextBox}" BasedOn="{StaticResource PlaceHolder}"> |
192 |
| - <Setter Property="Height" Value="20"></Setter> |
193 |
| - <Setter Property="Tag" Value="{Resx ResxName=Rubberduck.Resources.RubberduckUI, Key=References_SearchPlaceholder}" /> |
194 |
| - <Setter Property="Text" Value="{Binding Search, UpdateSourceTrigger=PropertyChanged}" /> |
195 |
| - </Style> |
196 |
| - </TextBox.Style> |
197 |
| - </TextBox> |
198 |
| - <Border Grid.Column="1" Margin="2"> |
199 |
| - <Image Source="{StaticResource SearchIcon}" /> |
200 |
| - </Border> |
201 |
| - <Button Grid.Column="2" Command="{Binding BrowseCommand}"> |
202 |
| - <Image Margin="2,0" Source="{StaticResource BrowseIcon}" /> |
203 |
| - </Button> |
204 |
| - </Grid> |
205 |
| - </Border> |
206 |
| - <Grid Grid.Row="2" Margin="10,10,10,5"> |
| 177 | + <Button Grid.Row="0" Height="24" Background="{x:Static SystemColors.ControlBrush}" Margin="0,0,10,0" |
| 178 | + BorderBrush="{x:Static SystemColors.ActiveBorderBrush}" Width="100" HorizontalAlignment="Right" |
| 179 | + Command="{Binding BrowseCommand}"> |
| 180 | + <StackPanel Orientation="Horizontal"> |
| 181 | + <Image Margin="0,0,5,0" Height="16" Source="{StaticResource BrowseIcon}" /> |
| 182 | + <TextBlock Background="Transparent" Text="Browse..."></TextBlock> |
| 183 | + </StackPanel> |
| 184 | + </Button> |
| 185 | + <Grid Grid.Row="1" Margin="10,10,10,5"> |
207 | 186 | <Grid.ColumnDefinitions>
|
208 | 187 | <ColumnDefinition Width="*" />
|
209 | 188 | <ColumnDefinition Width="50" />
|
210 | 189 | <ColumnDefinition Width="*" />
|
211 | 190 | </Grid.ColumnDefinitions>
|
212 |
| - <Border Grid.Column="0"> |
| 191 | + <Grid.RowDefinitions> |
| 192 | + <RowDefinition Height="Auto" /> |
| 193 | + <RowDefinition Height="*" /> |
| 194 | + </Grid.RowDefinitions> |
| 195 | + <Border Grid.Row="0" Grid.Column="0" |
| 196 | + Background="{x:Static SystemColors.ControlBrush}" |
| 197 | + BorderBrush="{x:Static SystemColors.ActiveBorderBrush}" |
| 198 | + BorderThickness="1" |
| 199 | + Margin="0,5" |
| 200 | + Padding="2"> |
| 201 | + <Grid> |
| 202 | + <Grid.ColumnDefinitions> |
| 203 | + <ColumnDefinition Width="*" /> |
| 204 | + <ColumnDefinition Width="20" /> |
| 205 | + </Grid.ColumnDefinitions> |
| 206 | + <TextBox Grid.Column="0"> |
| 207 | + <TextBox.Style> |
| 208 | + <Style TargetType="{x:Type TextBox}" BasedOn="{StaticResource PlaceHolder}"> |
| 209 | + <Setter Property="Height" Value="20" /> |
| 210 | + <Setter Property="Width" Value="Auto" /> |
| 211 | + <Setter Property="Tag" Value="{Resx ResxName=Rubberduck.Resources.RubberduckUI, Key=References_SearchPlaceholder}" /> |
| 212 | + <Setter Property="Text" Value="{Binding Search, UpdateSourceTrigger=PropertyChanged}" /> |
| 213 | + </Style> |
| 214 | + </TextBox.Style> |
| 215 | + </TextBox> |
| 216 | + <Border Grid.Column="1" Margin="2" Width="16" Height="16"> |
| 217 | + <Image Source="{StaticResource SearchIcon}" /> |
| 218 | + </Border> |
| 219 | + </Grid> |
| 220 | + </Border> |
| 221 | + <Border Grid.Row="1" Grid.Column="0"> |
213 | 222 | <ListView Name="LibrarySelect" SelectedItem="{Binding SelectedLibrary, Mode=TwoWay}" ItemsSource="{Binding AvailableReferences}" HorizontalContentAlignment="Stretch">
|
214 | 223 | <ListView.ItemContainerStyle>
|
215 | 224 | <Style TargetType="ListViewItem">
|
|
243 | 252 | </ListView.ItemTemplate>
|
244 | 253 | </ListView>
|
245 | 254 | </Border>
|
246 |
| - <StackPanel Grid.Column="1" VerticalAlignment="Center"> |
| 255 | + <StackPanel Grid.Row="1" Grid.Column="1" VerticalAlignment="Center"> |
247 | 256 | <Button Command="{Binding AddCommand}" Width="40" Height="20" Padding="0" Margin="0,1">
|
248 | 257 | <Image Margin="5,0" Source="{StaticResource AddIcon}" />
|
249 | 258 | </Button>
|
250 | 259 | <Button Command="{Binding RemoveCommand}" Width="40" Height="20" Padding="0" Margin="0,1">
|
251 | 260 | <Image Margin="5,0" Source="{StaticResource RemoveIcon}" />
|
252 | 261 | </Button>
|
253 | 262 | </StackPanel>
|
254 |
| - <Border Grid.Column="2"> |
| 263 | + <Border Grid.Row="1" Grid.Column="2"> |
255 | 264 | <ListView Name="ProjectSelect" SelectedItem="{Binding SelectedReference, Mode=TwoWay}" ItemsSource="{Binding ProjectReferences}" HorizontalContentAlignment="Stretch">
|
256 | 265 | <ListView.ItemContainerStyle>
|
257 | 266 | <Style TargetType="ListViewItem">
|
|
290 | 299 | <Style TargetType="{x:Type Button}">
|
291 | 300 | <Setter Property="Visibility" Value="Collapsed"/>
|
292 | 301 | <Style.Triggers>
|
293 |
| - <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ListBoxItem}},Path=IsSelected}" Value="True"> |
| 302 | + <DataTrigger Value="True"> |
| 303 | + <DataTrigger.Binding> |
| 304 | + <MultiBinding Converter="{StaticResource PriorityButtonVisibility}" ConverterParameter="Up"> |
| 305 | + <MultiBinding.Bindings> |
| 306 | + <Binding RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type ListBoxItem}}" Path="IsSelected" /> |
| 307 | + <Binding ElementName="ProjectSelect" Path="Items.Count"/> |
| 308 | + <Binding RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type ListBoxItem}}" Path="DataContext"/> |
| 309 | + <Binding RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type local:AddRemoveReferencesWindow}}" Path="DataContext.BuiltInReferenceCount"/> |
| 310 | + </MultiBinding.Bindings> |
| 311 | + </MultiBinding> |
| 312 | + </DataTrigger.Binding> |
294 | 313 | <Setter Property="Visibility" Value="Visible"/>
|
295 | 314 | </DataTrigger>
|
296 | 315 | </Style.Triggers>
|
|
306 | 325 | <Style TargetType="{x:Type Button}">
|
307 | 326 | <Setter Property="Visibility" Value="Collapsed"/>
|
308 | 327 | <Style.Triggers>
|
309 |
| - <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ListBoxItem}},Path=IsSelected}" Value="True"> |
| 328 | + <DataTrigger Value="True"> |
| 329 | + <DataTrigger.Binding> |
| 330 | + <MultiBinding Converter="{StaticResource PriorityButtonVisibility}" ConverterParameter="Down"> |
| 331 | + <MultiBinding.Bindings> |
| 332 | + <Binding RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type ListBoxItem}}" Path="IsSelected" /> |
| 333 | + <Binding ElementName="ProjectSelect" Path="Items.Count"/> |
| 334 | + <Binding RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type ListBoxItem}}" Path="DataContext"/> |
| 335 | + <Binding RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type local:AddRemoveReferencesWindow}}" Path="DataContext.BuiltInReferenceCount"/> |
| 336 | + </MultiBinding.Bindings> |
| 337 | + </MultiBinding> |
| 338 | + </DataTrigger.Binding> |
310 | 339 | <Setter Property="Visibility" Value="Visible"/>
|
311 | 340 | </DataTrigger>
|
312 | 341 | </Style.Triggers>
|
|
320 | 349 | </ListView>
|
321 | 350 | </Border>
|
322 | 351 | </Grid>
|
323 |
| - <Border Style="{StaticResource BorderStyle}" Grid.Row="3" Margin="10,0,10,0"> |
| 352 | + <Border Style="{StaticResource BorderStyle}" Grid.Row="2" Margin="10,0,10,0"> |
324 | 353 | <Border Style="{StaticResource BorderStyle}">
|
325 | 354 | <Grid>
|
326 | 355 | <Grid.RowDefinitions>
|
|
0 commit comments