Skip to content

Commit 931a6bc

Browse files
author
David Khristepher Santos
committed
Try to fix Focus on Preview
1 parent 4d3962f commit 931a6bc

4 files changed

Lines changed: 32 additions & 2 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using Diffusion.Common;
2+
using System;
3+
using System.Collections.Generic;
4+
using System.Linq;
5+
using System.Text;
6+
using System.Text.Json;
7+
using System.Threading.Tasks;
8+
9+
namespace Diffusion.Database
10+
{
11+
12+
public partial class Migrations
13+
{
14+
[Migrate(MigrationType.Post)]
15+
private string RupertAvery20260103_0001_SetImageType()
16+
{
17+
Logger.Log($"Setting Image Type");
18+
19+
return "UPDATE Image SET Type = 0";
20+
21+
}
22+
}
23+
}

Diffusion.Toolkit/Controls/PreviewPane.xaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
xmlns:lex="http://wpflocalizeextension.codeplex.com"
1212
xmlns:models="clr-namespace:Diffusion.Toolkit.Models"
1313
xmlns:common="clr-namespace:Diffusion.Common;assembly=Diffusion.Common"
14-
mc:Ignorable="d"
14+
mc:Ignorable="d"
15+
Focusable="True"
1516
d:DesignHeight="600" d:DesignWidth="800">
1617
<UserControl.Resources>
1718
<ResourceDictionary>

Diffusion.Toolkit/Preview.xaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@
6262
MouseDoubleClick="PreviewPane_OnMouseDoubleClick"
6363
KeyDown="PreviewPane_OnKeyDown"
6464
x:Name="PreviewPane"
65-
AllowDrop="True"
65+
AllowDrop="True"
66+
Loaded="PreviewPane_OnLoaded"
6667
Drop="PreviewPane_OnDrop"></controls:PreviewPane>
6768

6869

Diffusion.Toolkit/Preview.xaml.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,11 @@ private void PreviewPane_OnKeyDown(object sender, KeyEventArgs e)
257257
{
258258
OnKeyDown(e);
259259
}
260+
261+
private void PreviewPane_OnLoaded(object sender, RoutedEventArgs e)
262+
{
263+
PreviewPane.SetFocus();
264+
}
260265
}
261266

262267

0 commit comments

Comments
 (0)