So this photo is pretty self explaining itself:
The RowNumberConverter DOES exist in the same namespace but Visual Studio stupidly says that it doesn't! I did clean the solution and the app builds and runs with no problems but I can't see the designer! And all of this happened suddenly with no reason no idea why!
BTW that's a converter class for showing row numbers in an EntityFramework-binded DataGrid.
Update:
Converter file (RowNumberConverter.cs):
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
using System.Windows.Data;
namespace MyProject
{
class RowNumberConverter : IMultiValueConverter
{
#region IMultiValueConverter Members
public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
//get the grid and the item
Object item = values[0];
DataGrid grid = values[1] as DataGrid;
int index = grid.Items.IndexOf(item);
return (index < 0) ? "" : (index + 1).ToString();
}
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
#endregion
}
}
This has been an issue w/ VS for a long, long time. You need to set the build type to be "Any CPU" or x86, anything that is NOT x64. This is because (for reasons nobody understands), since VS is built from x86 code, it cannot show and display x64 code in the designer. Switch (temporarily) your project to x86, recompile, and presto, it will show up!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With