private void CreateBarcode(object sender, ExecutedRoutedEventArgs e)
        {
            if (MasterDataGrids[MasterTabControl.SelectedIndex].SelectionController.SelectedCells.Count > 0)
            {
                var sfd = new SaveFileDialog
                {
                    DefaultExt = ".png",
                    Filter     = @"PNG File (*.png)|*.png|JPG File(*.jpg)|*.jpg|JPEG File(*.jpeg)|*.jpeg"
                };

                if (sfd.ShowDialog() != true)
                {
                    return;
                }

                string item = BarcodeGenerator.GetItemStringFromDataRow(
                    ((DataRowView)MasterDataGrids[MasterTabControl.SelectedIndex].SelectionController
                     .SelectedCells[
                         MasterDataGrids[MasterTabControl.SelectedIndex].SelectionController.SelectedCells.Count - 1]
                     .RowData).Row);
                BarcodeGenerator.SaveBarcode(item, Path.GetFileNameWithoutExtension(sfd.FileName), sfd.FileName);
            }
            else if (MasterDataGrids[MasterTabControl.SelectedIndex].SelectionController.SelectedRows.Count > 0)
            {
                var sfd = new SaveFileDialog
                {
                    DefaultExt = ".png",
                    Filter     = @"PNG File (*.png)|*.png|JPG File(*.jpg)|*.jpg|JPEG File(*.jpeg)|*.jpeg"
                };

                if (sfd.ShowDialog() != true)
                {
                    return;
                }

                string item = BarcodeGenerator.GetItemStringFromDataRow(
                    ((DataRowView)MasterDataGrids[MasterTabControl.SelectedIndex].SelectionController
                     .SelectedRows[
                         MasterDataGrids[MasterTabControl.SelectedIndex].SelectionController.SelectedRows.Count - 1]
                     .RowData).Row);
                BarcodeGenerator.SaveBarcode(item, Path.GetFileNameWithoutExtension(sfd.FileName), sfd.FileName);
            }
        }