|
8 | 8 | xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
9 | 9 | xmlns:models="clr-namespace:Showcase.WPF.DragDrop.Models" |
10 | 10 | xmlns:viewModels="clr-namespace:Showcase.WPF.DragDrop.ViewModels" |
| 11 | + xmlns:b="http://schemas.microsoft.com/xaml/behaviors" |
11 | 12 | d:DataContext="{d:DesignInstance viewModels:MainViewModel}" |
12 | 13 | d:DesignHeight="400" |
13 | 14 | d:DesignWidth="600" |
|
1248 | 1249 | </DockPanel> |
1249 | 1250 | </TabItem> |
1250 | 1251 |
|
| 1252 | + <TabItem Header="#519"> |
| 1253 | + <TabItem.Resources> |
| 1254 | + <models:ComboBoxDropHandler x:Key="ComboBoxDropHandler"/> |
| 1255 | + <DataTemplate x:Key="DefaultDropHintTemplate" DataType="{x:Type dd:DropHintData}"> |
| 1256 | + <Border x:Name="RootBorder" |
| 1257 | + Background="#008000" |
| 1258 | + BorderBrush="#008000" |
| 1259 | + BorderThickness="1" |
| 1260 | + CornerRadius="5"> |
| 1261 | + <TextBlock HorizontalAlignment="Center" |
| 1262 | + VerticalAlignment="Center" |
| 1263 | + Foreground="White" |
| 1264 | + Text="{Binding HintText}" |
| 1265 | + TextWrapping="Wrap" /> |
| 1266 | + </Border> |
| 1267 | + <DataTemplate.Triggers> |
| 1268 | + <DataTrigger Binding="{Binding Path=HintState}" Value="Active"> |
| 1269 | + <Setter TargetName="RootBorder" Property="Background" Value="#263B80" /> |
| 1270 | + </DataTrigger> |
| 1271 | + <DataTrigger Binding="{Binding Path=HintState}" Value="Error"> |
| 1272 | + <Setter TargetName="RootBorder" Property="Background" Value="#8B0000" /> |
| 1273 | + </DataTrigger> |
| 1274 | + </DataTemplate.Triggers> |
| 1275 | + </DataTemplate> |
| 1276 | + </TabItem.Resources> |
| 1277 | + <DockPanel LastChildFill="True"> |
| 1278 | + <Grid DockPanel.Dock="Top"> |
| 1279 | + <TextBlock Style="{StaticResource SampleHeaderTextBlockStyle}" Text="Drop hint not available for TextBox part of ComboBox when IsEditable=true." /> |
| 1280 | + <Button CommandParameter="519" |
| 1281 | + Style="{StaticResource GitHubPullRequestButtonStyle}" |
| 1282 | + ToolTip="Open #519 on Github" /> |
| 1283 | + </Grid> |
| 1284 | + <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto"> |
| 1285 | + <StackPanel> |
| 1286 | + |
| 1287 | + <UniformGrid Columns="3"> |
| 1288 | + <TextBlock Text="#1 allows drop only on glyph" TextWrapping="Wrap"/> |
| 1289 | + <TextBlock Text="#2 allows on whole (behavior)" TextWrapping="Wrap"/> |
| 1290 | + <TextBlock Text="#3 allows on whole " TextWrapping="Wrap"/> |
| 1291 | + <ComboBox IsEditable="True" |
| 1292 | + Text="IsEditable" |
| 1293 | + Margin="2" |
| 1294 | + Width="150" |
| 1295 | + dd:DragDrop.IsDropTarget="True" |
| 1296 | + dd:DragDrop.DropHandler="{StaticResource ComboBoxDropHandler}" |
| 1297 | + dd:DragDrop.UseDropTargetHint="True" |
| 1298 | + dd:DragDrop.DropHintDataTemplate="{StaticResource DefaultDropHintTemplate}" |
| 1299 | + /> |
| 1300 | + <ComboBox IsEditable="True" |
| 1301 | + Text="IsEditable Behavior" |
| 1302 | + Margin="2" |
| 1303 | + Width="150" |
| 1304 | + dd:DragDrop.IsDropTarget="True" |
| 1305 | + dd:DragDrop.DropHandler="{StaticResource ComboBoxDropHandler}" |
| 1306 | + dd:DragDrop.UseDropTargetHint="True" |
| 1307 | + dd:DragDrop.DropHintDataTemplate="{StaticResource DefaultDropHintTemplate}"> |
| 1308 | + <b:Interaction.Behaviors> |
| 1309 | + <models:ComboBoxDropBehavior /> |
| 1310 | + </b:Interaction.Behaviors> |
| 1311 | + </ComboBox> |
| 1312 | + <ComboBox IsEditable="False" |
| 1313 | + Text="IsEditable False" |
| 1314 | + Margin="2" |
| 1315 | + Width="150" |
| 1316 | + dd:DragDrop.IsDropTarget="True" |
| 1317 | + dd:DragDrop.DropHandler="{StaticResource ComboBoxDropHandler}" |
| 1318 | + dd:DragDrop.UseDropTargetHint="True" |
| 1319 | + dd:DragDrop.DropHintDataTemplate="{StaticResource DefaultDropHintTemplate}" |
| 1320 | + /> |
| 1321 | + </UniformGrid> |
| 1322 | + <Grid> |
| 1323 | + <Grid.ColumnDefinitions> |
| 1324 | + <ColumnDefinition Width="Auto" /> |
| 1325 | + </Grid.ColumnDefinitions> |
| 1326 | + |
| 1327 | + <ListBox MinWidth="200" |
| 1328 | + dd:DragDrop.IsDragSource="True"> |
| 1329 | + <ListBoxItem Content="Item 1" /> |
| 1330 | + <ListBoxItem Content="Item 2" /> |
| 1331 | + <ListBoxItem Content="Item 3" /> |
| 1332 | + <ListBoxItem Content="Item 4" /> |
| 1333 | + <ListBoxItem Content="Item 5" /> |
| 1334 | + </ListBox> |
| 1335 | + </Grid> |
| 1336 | + </StackPanel> |
| 1337 | + </ScrollViewer> |
| 1338 | + </DockPanel> |
| 1339 | + </TabItem> |
1251 | 1340 | </TabControl> |
1252 | 1341 |
|
1253 | 1342 | </Grid> |
|
0 commit comments