티스토리 뷰
반응형
BrowseViewModel이 BrowseDialog에 바인딩되어야하는 하나의 클래스 이름 BrowseViewModel과 BrowseDialog라는 하나의 클래스가 있지만 내 버튼 중 하나에서 내 Click 명령에 바인딩을 작성할 때 오류가 발생합니다. 두 번째로 프로그램을 시작합니다. 이것은 내 코드입니다 .
BrowseDialog.xaml
<Window x:Class="TextalkApi.BrowseDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:TextalkApi"
mc:Ignorable="d"
Title="BrowseDialog" Height="248.361" Width="427.459">
<Grid>
<Button Content="Browse" HorizontalAlignment="Left" Margin="267,11,0,0" VerticalAlignment="Top" Width="75"/>
<TextBox x:Name="FileDialog" HorizontalAlignment="Left" Height="23" Margin="10,10,0,0" TextWrapping="Wrap" Text="{Binding webUrl}" VerticalAlignment="Top" Width="244"/>
<Button Content="Save" HorizontalAlignment="Left" Margin="267,166,0,0" VerticalAlignment="Top" Width="75" Click="{Binding SaveCommand}" />
<TextBox HorizontalAlignment="Left" Height="23" Margin="10,38,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="120"/>
</Grid>
</Window>
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Input;
using System.Threading;
using System.Threading.Tasks;
using System.Configuration;
using System.Collections.Specialized;
using System.IO;
namespace Data
{
public class BrowseViewModel : BaseViewModel
{
#region public variables
public string webUrl { get; set; }
#endregion
#region Public Commands
public ICommand SaveCommand { get; set; }
#endregion
#region Constructor
public BrowseViewModel()
{
this.SaveCommand = new RelayCommand(SaveFilePath);
}
#endregion
#region Private methods
private void SaveFilePath()
{
if (File.Exists(webUrl))
{
ConfigurationManager.AppSettings.Add("WebUrl", webUrl);
}
else
{
}
}
#endregion
}
}
반응형
'프로그래밍' 카테고리의 다른 글
스핀 락 및 보호 된 데이터를위한 스토리지 제공 (0) | 2020.03.02 |
---|---|
커널모드 동기화 기법 - 스핀 락 (0) | 2020.03.02 |
두 번째 파일 형식에 표시되는 첫 번째 파일 형식 미리보기 이미지 (0) | 2020.03.02 |
C# BeginRead (0) | 2020.03.02 |
VUEX, $ store.state가 null 일 때 수행 할 작업 (0) | 2020.03.02 |
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- go
- frida
- Backend
- ChatGPT
- Java
- 투자
- JavaScript
- JSX
- Linux
- 생각
- HTML
- WinAPI
- 주식
- Windows
- SWiFT
- Frontend
- 트렌드
- 스핀락
- reactjs
- Python
- 유튜브
- ios
- golang
- 커널드라이버
- 예제
- CSS
- Spring
- 파이썬
- 부동산
- react
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
글 보관함