public MainPageState SaveState()
        {
            var state = new MainPageState()
            {
                HostName = this.HostName,
                PortNumber = this.PortNumber
            };

            return state;
        }
        public void LoadState(MainPageState state)
        {
            if (!String.IsNullOrWhiteSpace(state.HostName))
            {
                HostName = state.HostName;
            }

            if (!String.IsNullOrWhiteSpace(state.PortNumber))
            {
                PortNumber = state.PortNumber;
            }
        }