mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 08:56:30 +00:00
fix dataset explorer view
This commit is contained in:
@@ -24,7 +24,8 @@
|
|||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
VerticalContentAlignment="Center"
|
VerticalContentAlignment="Center"
|
||||||
Text="{Binding Value, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource AncestorType={x:Type local:NumericUpDown}}}"
|
Text="{Binding Value, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource AncestorType={x:Type local:NumericUpDown}}}"
|
||||||
TextChanged="NUDTextBox_OnTextChanged"/>
|
LostFocus="NudTextBox_OnLostFocus"
|
||||||
|
/>
|
||||||
<RepeatButton
|
<RepeatButton
|
||||||
Name="NudButtonUp"
|
Name="NudButtonUp"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
|
|||||||
@@ -56,7 +56,25 @@ public partial class NumericUpDown : UserControl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void NUDTextBox_OnTextChanged(object sender, TextChangedEventArgs e)
|
private void NudButtonUp_OnClick(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
var step = Step <= 0 ? 1m : Step;
|
||||||
|
var newVal = Math.Min(MaxValue, Value + step);
|
||||||
|
Value = newVal;
|
||||||
|
NudTextBox.Text = Value.ToString(CultureInfo.InvariantCulture);
|
||||||
|
NudTextBox.SelectionStart = NudTextBox.Text.Length;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void NudButtonDown_OnClick(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
var step = Step <= 0 ? 1m : Step;
|
||||||
|
var newVal = Math.Max(MinValue, Value - step);
|
||||||
|
Value = newVal;
|
||||||
|
NudTextBox.Text = Value.ToString(CultureInfo.InvariantCulture);
|
||||||
|
NudTextBox.SelectionStart = NudTextBox.Text.Length;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void NudTextBox_OnLostFocus(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(NudTextBox.Text) || !decimal.TryParse(NudTextBox.Text, NumberStyles.Any, CultureInfo.InvariantCulture, out var number))
|
if (string.IsNullOrEmpty(NudTextBox.Text) || !decimal.TryParse(NudTextBox.Text, NumberStyles.Any, CultureInfo.InvariantCulture, out var number))
|
||||||
{
|
{
|
||||||
@@ -80,22 +98,4 @@ public partial class NumericUpDown : UserControl
|
|||||||
|
|
||||||
NudTextBox.SelectionStart = NudTextBox.Text.Length;
|
NudTextBox.SelectionStart = NudTextBox.Text.Length;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void NudButtonUp_OnClick(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
var step = Step <= 0 ? 1m : Step;
|
|
||||||
var newVal = Math.Min(MaxValue, Value + step);
|
|
||||||
Value = newVal;
|
|
||||||
NudTextBox.Text = Value.ToString(CultureInfo.InvariantCulture);
|
|
||||||
NudTextBox.SelectionStart = NudTextBox.Text.Length;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void NudButtonDown_OnClick(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
var step = Step <= 0 ? 1m : Step;
|
|
||||||
var newVal = Math.Max(MinValue, Value - step);
|
|
||||||
Value = newVal;
|
|
||||||
NudTextBox.Text = Value.ToString(CultureInfo.InvariantCulture);
|
|
||||||
NudTextBox.SelectionStart = NudTextBox.Text.Length;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -195,11 +195,12 @@ public partial class DatasetExplorer
|
|||||||
ThumbnailsView.SelectedIndex = index;
|
ThumbnailsView.SelectedIndex = index;
|
||||||
|
|
||||||
var ann = CurrentAnnotation.Annotation;
|
var ann = CurrentAnnotation.Annotation;
|
||||||
ExplorerEditor.SetBackground(await ann.ImagePath.OpenImage());
|
var image = await ann.ImagePath.OpenImage();
|
||||||
|
ExplorerEditor.SetBackground(image);
|
||||||
SwitchTab(toEditor: true);
|
SwitchTab(toEditor: true);
|
||||||
|
|
||||||
ExplorerEditor.RemoveAllAnns();
|
ExplorerEditor.RemoveAllAnns();
|
||||||
ExplorerEditor.CreateDetections(ann, _appConfig.AnnotationConfig.DetectionClasses, ExplorerEditor.RenderSize);
|
ExplorerEditor.CreateDetections(ann, _appConfig.AnnotationConfig.DetectionClasses, new Size(image.PixelWidth, image.PixelHeight));
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user