Skip to content

Commit

Permalink
BugFix in OnTextChangedCallback
Browse files Browse the repository at this point in the history
  • Loading branch information
Dirkster99 committed Sep 3, 2017
1 parent 74f34ba commit b804851
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
Binary file modified source/.vs/InPlaceEditTextBoxDemo/v15/sqlite3/storage.ide
Binary file not shown.
1 change: 0 additions & 1 deletion source/InplaceEditBoxLib/InplaceEditBoxLib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<None Include="README.md" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Expand Down
26 changes: 13 additions & 13 deletions source/InplaceEditBoxLib/Views/EditBox.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -604,10 +604,10 @@ private void OnPreviewTextInput(object sender, TextCompositionEventArgs e)
/// <param name="e"></param>
private static void OnTextChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
////d.CoerceValue(EditBox.TextProperty);
var vm = (EditBox)d;

vm.Text = (string)e.NewValue;
d.CoerceValue(EditBox.TextProperty);
////var vm = (EditBox)d;
////
////vm.Text = (string)e.NewValue;
}

/// <summary>
Expand Down Expand Up @@ -716,25 +716,25 @@ private void OnSwitchToNormalMode(bool bCancelEdit = true)
/// </summary>
private void OnSwitchToEditingMode()
{
lock (this._lockObject)
lock (_lockObject)
{
if (this.IsReadOnly == false && this.IsEditing == false)
if (IsReadOnly == false && IsEditing == false)
{
if (this._PART_MeasureTextBlock != null && this._PART_TextBlock != null)
if (_PART_MeasureTextBlock != null && _PART_TextBlock != null)
{
if (this._TextBox == null)
this.HookItemsControlEvents();
if (_TextBox == null)
HookItemsControlEvents();

this._PART_TextBlock.Visibility = System.Windows.Visibility.Hidden;
this._PART_MeasureTextBlock.Visibility = System.Windows.Visibility.Hidden;
_PART_TextBlock.Visibility = System.Windows.Visibility.Hidden;
_PART_MeasureTextBlock.Visibility = System.Windows.Visibility.Hidden;

// Bugfix: Need to do this instead of = this.mPART_TextBlock.Text;
// in order to display one string
// but use the correct string in edit mode.
this._TextBox.Text = this.Text;
_TextBox.Text = Text;
}

this.IsEditing = true;
IsEditing = true;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion source/SolutionLib/Interfaces/ISolutionBaseItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public interface ISolutionBaseItem : IEditBox, INotifyPropertyChanged

/// <summary>
/// Renames a child item int the collection of children in this item.
/// A re-sort and IsItemSelected is applied after the rename such that
/// A re-sort and IsItemSelected should be applied after the rename such that
/// the renamed it should re-appear at the correct position in the sorted
/// list of items.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,9 @@ public bool RemoveChild(ISolutionBaseItem item)
}

/// <summary>
/// Renames a child item int the collection of children in this item.
/// A re-sort and IsItemSelected is applied after the rename such that
/// the renamed it should re-appear at the correct position in the sorted
/// Renames a child item in the collection of children in this item.
/// A re-sort and IsItemSelected should be applied after the rename such that
/// the renamed item should re-appear at the correct position in the sorted
/// list of items.
/// </summary>
/// <param name="item"></param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public void RenameItem(ISolutionBaseItem item, string newName)
{
_dictionary.Remove(item.DisplayName);
item.SetDisplayName(newName);

item.SortKey = GenSortKey(item);
_dictionary.Add(newName, item);
}
Expand Down

0 comments on commit b804851

Please sign in to comment.