ChartWindow: Fix AbgewertetInput Unchecked
This commit is contained in:
@ -74,7 +74,7 @@
|
||||
</xctk:CheckComboBox.ItemTemplate>
|
||||
</xctk:CheckComboBox>
|
||||
|
||||
<CheckBox x:Name="AbgewertetInput" Content="Abgewertet" IsEnabled="False" Checked="AbgewertetInput_Changed"
|
||||
<CheckBox x:Name="AbgewertetInput" Content="Abgewertet" IsEnabled="False" Checked="AbgewertetInput_Changed" Unchecked="AbgewertetInput_Changed"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Left" Margin="0,0,0,0" Grid.Column="1"/>
|
||||
</Grid>
|
||||
|
||||
|
@ -96,7 +96,7 @@ namespace Elwig.Windows {
|
||||
FillingInputs = true;
|
||||
ControlUtils.RenewItemsSource(ContractInput, contracts, g => (g as ContractSelection)?.Listing);
|
||||
FillingInputs = false;
|
||||
ControlUtils.RenewItemsSource(GraphList, GraphEntries, g => (g as GraphEntry)?.Id, GraphList_SelectionChanged, ControlUtils.RenewSourceDefault.First);
|
||||
ControlUtils.RenewItemsSource(GraphList, GraphEntries, g => (g as GraphEntry)?.ContractsStringSimple, GraphList_SelectionChanged, ControlUtils.RenewSourceDefault.First);
|
||||
|
||||
RefreshInputs();
|
||||
}
|
||||
@ -137,6 +137,7 @@ namespace Elwig.Windows {
|
||||
private void FillInputs() {
|
||||
FillingInputs = true;
|
||||
|
||||
AbgewertetInput.IsChecked = SelectedGraphEntry?.Abgewertet;
|
||||
if (SelectedGraphEntry?.GebundenFlatBonus is double bonus) {
|
||||
GebundenTypeFixed.IsChecked = true;
|
||||
GebundenFlatBonus.Text = $"{bonus}";
|
||||
@ -418,8 +419,9 @@ namespace Elwig.Windows {
|
||||
}
|
||||
|
||||
private void PriceInput_TextChanged(object sender, TextChangedEventArgs evt) {
|
||||
if (PrimaryMarkedPoint != -1 && ActiveGraph != null) {
|
||||
if (double.TryParse(PriceInput.Text, out double price)) {
|
||||
if (PrimaryMarkedPoint != -1 && ActiveGraph != null && PriceInput.IsKeyboardFocusWithin == true) {
|
||||
var res = Validator.CheckDecimal(PriceInput.TextBox, true, 2, Season.Precision);
|
||||
if (res.IsValid && double.TryParse(PriceInput.Text, out double price)) {
|
||||
ActiveGraph.SetPriceAt(PrimaryMarkedPoint, price);
|
||||
PrimaryMarkedPointPlot.Location = new Coordinates(PrimaryMarkedPointPlot.Location.X, price);
|
||||
SetHasChanged();
|
||||
@ -642,6 +644,7 @@ namespace Elwig.Windows {
|
||||
tr = Context.Update(PaymentVar);
|
||||
await Context.SaveChangesAsync();
|
||||
LockContext = false;
|
||||
tr = null;
|
||||
await App.HintContextChange();
|
||||
} catch (Exception exc) {
|
||||
if (tr != null) await tr.ReloadAsync();
|
||||
@ -720,13 +723,14 @@ namespace Elwig.Windows {
|
||||
}
|
||||
var r = ContractInput.SelectedItems.Cast<ContractSelection>();
|
||||
SelectedGraphEntry!.Contracts = r.ToList();
|
||||
SetHasChanged();
|
||||
GraphList.Items.Refresh();
|
||||
}
|
||||
|
||||
private void RemoveContractFromOtherGraphEntries(string? contract) {
|
||||
if (contract == null) return;
|
||||
foreach (var ge in GraphEntries) {
|
||||
if (ge != SelectedGraphEntry) {
|
||||
if (ge != SelectedGraphEntry && ge.Abgewertet == SelectedGraphEntry?.Abgewertet) {
|
||||
ge.Contracts.RemoveAll(c => c.Listing.Equals(contract));
|
||||
}
|
||||
}
|
||||
@ -737,6 +741,7 @@ namespace Elwig.Windows {
|
||||
if (SelectedGraphEntry == null) return;
|
||||
SelectedGraphEntry.Abgewertet = AbgewertetInput.IsChecked == true;
|
||||
SetHasChanged();
|
||||
GraphList.Items.Refresh();
|
||||
}
|
||||
|
||||
private void GebundenType_Checked(object sender, RoutedEventArgs e) {
|
||||
|
Reference in New Issue
Block a user