using System.Windows; using System.Windows.Controls; using System.Windows.Controls.Primitives; using System.Windows.Media; namespace AirPlanner { public partial class RoomDetailView : UserControl { // 거실 : 표시램프만 // 침실1 : 안심회복 + 표시램프 + 제습기 연동 (안심회복은 침실1 전용) // 침실2·침실3 : 표시램프 + 제습기 연동 public RoomDetailView(string roomName) { InitializeComponent(); bool isBedroom = roomName != "거실"; if (roomName == "침실1") TogglePanel.Children.Add(MakeRow("안심회복", false)); TogglePanel.Children.Add(MakeRow("표시램프", true)); if (isBedroom) TogglePanel.Children.Add(MakeRow("제습기 연동", false)); } FrameworkElement MakeRow(string label, bool on) { var sp = new StackPanel { Orientation = Orientation.Horizontal, Margin = new Thickness(0, 0, 0, 12) }; sp.Children.Add(new TextBlock { Text = label, FontSize = 18, VerticalAlignment = VerticalAlignment.Center, Foreground = (Brush)FindResource("Ink"), Margin = new Thickness(0, 0, 12, 0), MinWidth = 86 }); sp.Children.Add(new ToggleButton { Style = (Style)FindResource("Toggle"), IsChecked = on }); return sp; } } }