You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I'm attempting to use this project to make a hex based board game. I'm not sure if you're still active or not, but if you have the time to answer my question it would be greatly appreciated.
I currently have a custom control called MapGridView.xaml and is as shown below:
Which has a datacontext of the following viewmodel:
`public class MapGridViewModel : ViewModelBase
{
#region Fields
private ObservableCollection<Coordinate2D> _tileCoordinates;
#endregion
#region Ctor
public MapGridViewModel(HexGrid hexGrid)
{
Tiles = new ObservableCollection<Coordinate2D>(hexGrid.Hexes);
}
#endregion
#region Properties
public ObservableCollection<Coordinate2D> Tiles
{
get { return _tileCoordinates; }
set
{
if (_tileCoordinates == value) return;
_tileCoordinates = value;
OnPropertyChanged(nameof(Tiles));
}
}
#endregion
}`
When I run the application all I get is a single hex on the screen. I've checked to ensure that my Tiles are indeed populated with many coordinates, so I'm not sure why each row/column in the control is not populating. I checked your demo to see how you did your board and saw you setup the itemssource in the codebehind and just bound it too a list which was just a struct you made, similar to my Coordinate2D object. I tried that and it worked fine. So I'm not sure why the bindings to the X and Y property on my Coordinate2D object is not working.
I couldn't get some of the code to format properly in github, sorry about that.
The text was updated successfully, but these errors were encountered:
I tried instead using your IntPoint data type for my ObservableCollection type instead of ObservableCollection which comes from another nuget package called HexCore. The bindings work fine using IntPoint, but not using Coordinate2D. I'm not sure what is the issue. Did your code specifically make it so that the bindings work with only that IntPoint type from your demo code?
Hello, I'm attempting to use this project to make a hex based board game. I'm not sure if you're still active or not, but if you have the time to answer my question it would be greatly appreciated.
I currently have a custom control called MapGridView.xaml and is as shown below:
Which has a datacontext of the following viewmodel:
`public class MapGridViewModel : ViewModelBase
{
#region Fields
When I run the application all I get is a single hex on the screen. I've checked to ensure that my Tiles are indeed populated with many coordinates, so I'm not sure why each row/column in the control is not populating. I checked your demo to see how you did your board and saw you setup the itemssource in the codebehind and just bound it too a list which was just a struct you made, similar to my Coordinate2D object. I tried that and it worked fine. So I'm not sure why the bindings to the X and Y property on my Coordinate2D object is not working.
I couldn't get some of the code to format properly in github, sorry about that.
The text was updated successfully, but these errors were encountered: