Skip to content

Commit

Permalink
Property selected bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Otykier committed Apr 18, 2018
1 parent 5cf9e41 commit 28d5990
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion TabularEditor/UI/UIController_ExpressionEditor.cs
Expand Up @@ -101,6 +101,7 @@ private void ExpressionEditor_ExpressionSelectorChanged(object sender, EventArgs
{
if (ExpressionEditor_Current is IDaxDependantObject)
{
SetText(UI.ExpressionEditor.Text, LastDaxProperty);
ExpressionEditor_SetText();
}
}
Expand Down Expand Up @@ -211,6 +212,18 @@ private void SetText(string value)
}
}

private void SetText(string value, DAXProperty prop)
{
if (ExpressionEditor_Current is IDaxDependantObject)
{
(ExpressionEditor_Current as IDaxDependantObject).SetDAX(prop, value);
}
else if (ExpressionEditor_Current != null)
{
ExpressionEditor_Current.Expression = value;
}
}

private DAXProperty CurrentDaxProperty
{
get
Expand All @@ -222,6 +235,7 @@ private DAXProperty CurrentDaxProperty
UI.ExpressionSelector.SelectedItem = DaxPropertyComboBoxItem.Items[value];
}
}
private DAXProperty LastDaxProperty;

private void ExpressionEditor_SetText()
{
Expand All @@ -243,12 +257,15 @@ private void ExpressionEditor_SetText()
{
UI.CurrentMeasureLabel.Text = (_expressionEditor_Current as IDaxObject).DaxObjectName + " :=";
UI.CurrentMeasureLabel.Visible = true;
} else
}
else
{
UI.CurrentMeasureLabel.Visible = false;
}

UI.ExpressionEditor.TextChanged += ExpressionEditor_TextChanged;

LastDaxProperty = CurrentDaxProperty;
}

private void ExpressionEditor_Preview()
Expand Down

0 comments on commit 28d5990

Please sign in to comment.