move add button to the right if ok button is not visible
This commit is contained in:
parent
d52d8b90bb
commit
bb5de64cab
@ -53,7 +53,13 @@ namespace ENI2.Controls
|
|||||||
public bool AddVisible
|
public bool AddVisible
|
||||||
{
|
{
|
||||||
get { var addButton = (Button)Template.FindName("buttonAdd", this); return addButton.Visibility == Visibility.Visible; }
|
get { var addButton = (Button)Template.FindName("buttonAdd", this); return addButton.Visibility == Visibility.Visible; }
|
||||||
set { var addButton = (Button)Template.FindName("buttonAdd", this); addButton.Visibility = value ? Visibility.Visible : Visibility.Hidden; }
|
set
|
||||||
|
{
|
||||||
|
var addButton = (Button)Template.FindName("buttonAdd", this); addButton.Visibility = value ? Visibility.Visible : Visibility.Hidden;
|
||||||
|
var okButton = (Button)Template.FindName("buttonOK", this);
|
||||||
|
if (okButton.Visibility == Visibility.Hidden)
|
||||||
|
okButton.Width = 1; // we are in a DockPanel, try to collapse okButton to place addButton more to the right
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool OkVisible
|
public bool OkVisible
|
||||||
|
|||||||
@ -39,8 +39,8 @@ namespace ENI2.EditControls
|
|||||||
_data = LocalizedLookup.LoadHAZTemplates();
|
_data = LocalizedLookup.LoadHAZTemplates();
|
||||||
this.listBoxDescription.ItemsSource = _data;
|
this.listBoxDescription.ItemsSource = _data;
|
||||||
this.comboBoxType.ItemsSource = Enum.GetValues(typeof(HAZPosTemplate.SublistType));
|
this.comboBoxType.ItemsSource = Enum.GetValues(typeof(HAZPosTemplate.SublistType));
|
||||||
this.AddVisible = true;
|
|
||||||
this.OkVisible = false;
|
this.OkVisible = false;
|
||||||
|
this.AddVisible = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void comboBoxType_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
private void comboBoxType_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user