Example #1
0
        public CastSizePlanningDlg(CastSizePlanningViewModel viewModel)
        {
            InitializeComponent();
            m_viewModel = viewModel;
            m_viewModel.MaleNarratorsValueChanged   += m_viewModel_MaleNarratorsValueChanged;
            m_viewModel.FemaleNarratorsValueChanged += m_viewModel_FemaleNarratorsValueChanged;
            m_castSizePlanningOptions.SetViewModel(m_viewModel);

            HandleStringsLocalized();
            LocalizeItemDlg.StringsLocalized += HandleStringsLocalized;

            m_tableLayoutStartingOver.Visible = m_viewModel.Project.CharacterGroupListPreviouslyGenerated;
            m_maleNarrators.Maximum           = m_viewModel.MaximumNarratorsValue;
            SetMinimumMaleNarrators();
            m_maleNarrators.Value     = m_viewModel.MaleNarrators;
            m_femaleNarrators.Maximum = m_maleNarrators.Maximum;
            m_femaleNarrators.Value   = m_viewModel.FemaleNarrators;

            NarratorOption = m_viewModel.NarratorOption;
            CastSizeOption = m_viewModel.CastSizeOption;

            // set the warning icon
            m_imgNarratorWarning.Image = SystemIcons.Error.ToBitmap();

            m_loaded = true;
        }