Giter Site home page Giter Site logo

hexgrid's People

Contributors

alexandersharykin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

hexgrid's Issues

License

On CodeProject, this is licensed under the CPOL which is incompatible with the license of the project I'd like to incorporate this into. Would you consider relicensing to something that's, IMO, better, such as MIT?

Larger Hex size wanted

First, thank you for making your project available. I appreciate you taking the time to do that.

Secondly, I need to have a 25 x 25 hex list with horizontal orientation. I have spent significant time with the code to figure out how I might create much larger hexagons, but with no luck. I'm not great at WPF and I'm still learning, so any suggestions you could offer would be helpful.

image

The image shows what I am getting, which is far too compacted for me.

Thank you,

David.

Can't get hexes to show up using MVVM.

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:

<Grid>
    <hx:HexList Grid.Row="0" Grid.Column="0" Name="Board" 
            Margin="5"
            RowCount="6" ColumnCount="8"
            Orientation="Vertical" ItemsSource="{Binding Tiles}">
        <hx:HexList.ItemContainerStyle>
            <Style TargetType="{x:Type hx:HexItem}">
                <Setter Property="Grid.Row" Value="{Binding Path=X}"/>
                <Setter Property="Grid.Column" Value="{Binding Path=Y}"/>
                <Setter Property="BorderThickness" Value="1.5"/>
                <Setter Property="FontSize" Value="16"/>
                <Setter Property="Background" Value="White"/>
            </Style>
        </hx:HexList.ItemContainerStyle>
    </hx:HexList>
</Grid>

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.