/// <summary>
 /// Initialize stream and hexeditor
 /// </summary>
 private void InitializeMStreamFind()
 {
     FindHexEdit.CloseProvider();
     _findMs = new MemoryStream(1);
     _findMs.WriteByte(0);
     FindHexEdit.Stream = _findMs;
 }
        /// <summary>
        /// Initialize stream and hexeditor
        /// </summary>
        private void InitializeMStream(byte[] findData = null)
        {
            FindHexEdit.CloseProvider();

            _findMs = new MemoryStream(1);

            if (findData is not null && findData.Length > 0)
            {
                foreach (byte b in findData)
                {
                    _findMs.WriteByte(b);
                }
            }
 private void FindHexEdit_BytesDeleted(object sender, System.EventArgs e) =>
 InitializeMStream(FindHexEdit, FindHexEdit.GetAllBytes());
 private void ReplaceAllButton_Click(object sender, RoutedEventArgs e) =>
 _parent?.ReplaceAll(FindHexEdit.GetAllBytes(), ReplaceHexEdit.GetAllBytes(),
                     TrimMenuItem.IsChecked, HighlightMenuItem.IsChecked);
 private void FindLastButton_Click(object sender, RoutedEventArgs e) =>
 _parent?.FindLast(FindHexEdit.GetAllBytes(), HighlightMenuItem.IsChecked);
 private void FindLastButton_Click(object sender, RoutedEventArgs e) =>
 _parent?.FindLast(FindHexEdit.GetAllBytes());